Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CFC11, CFC12 tracers #4552

Merged
merged 4 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions components/mpas-ocean/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,20 @@ add_default($nl, 'config_use_idealAgeTracers_exponential_decay');
add_default($nl, 'config_use_idealAgeTracers_idealAge_forcing');
add_default($nl, 'config_use_idealAgeTracers_ttd_forcing');

###############################################
# Namelist group: tracer_forcing_CFCTracers #
###############################################

add_default($nl, 'config_use_CFCTracers');
add_default($nl, 'config_use_CFCTracers_surface_bulk_forcing');
add_default($nl, 'config_use_CFCTracers_surface_restoring');
add_default($nl, 'config_use_CFCTracers_interior_restoring');
add_default($nl, 'config_use_CFCTracers_exponential_decay');
add_default($nl, 'config_use_CFCTracers_idealAge_forcing');
add_default($nl, 'config_use_CFCTracers_ttd_forcing');
add_default($nl, 'config_use_CFC11');
add_default($nl, 'config_use_CFC12');

##################################
# Namelist group: AM_globalStats #
##################################
Expand Down Expand Up @@ -1651,6 +1665,7 @@ my @groups = qw(run_modes
tracer_forcing_dmstracers
tracer_forcing_macromoleculestracers
tracer_forcing_idealagetracers
tracer_forcing_cfctracers
am_globalstats
am_surfaceareaweightedaverages
am_watermasscensus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,17 @@
<config_use_idealAgeTracers_idealAge_forcing>.true.</config_use_idealAgeTracers_idealAge_forcing>
<config_use_idealAgeTracers_ttd_forcing>.false.</config_use_idealAgeTracers_ttd_forcing>

<!-- tracer_forcing_CFCTracers -->
<config_use_CFCTracers>.false.</config_use_CFCTracers>
<config_use_CFCTracers_surface_bulk_forcing>.false.</config_use_CFCTracers_surface_bulk_forcing>
<config_use_CFCTracers_surface_restoring>.false.</config_use_CFCTracers_surface_restoring>
<config_use_CFCTracers_interior_restoring>.false.</config_use_CFCTracers_interior_restoring>
<config_use_CFCTracers_exponential_decay>.false.</config_use_CFCTracers_exponential_decay>
<config_use_CFCTracers_idealAge_forcing>.false.</config_use_CFCTracers_idealAge_forcing>
<config_use_CFCTracers_ttd_forcing>.false.</config_use_CFCTracers_ttd_forcing>
<config_use_CFC11>.true.</config_use_CFC11>
<config_use_CFC12>.true.</config_use_CFC12>

<!-- AM_globalStats -->
<config_AM_globalStats_enable>.true.</config_AM_globalStats_enable>
<config_AM_globalStats_compute_interval>'output_interval'</config_AM_globalStats_compute_interval>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2766,6 +2766,79 @@ Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<!-- tracer_forcing_CFCTracers -->

<entry id="config_use_CFCTracers" type="logical"
category="tracer_forcing_CFCTracers" group="tracer_forcing_CFCTracers">
if true, the 'CFCTracers' category is enabled for the run

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_use_CFCTracers_surface_bulk_forcing" type="logical"
category="tracer_forcing_CFCTracers" group="tracer_forcing_CFCTracers">
if true, surface bulk forcing from coupler is added to surfaceTracerFlux in 'CFCTracers' category

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_use_CFCTracers_surface_restoring" type="logical"
category="tracer_forcing_CFCTracers" group="tracer_forcing_CFCTracers">
if true, surface restoring source is applied to tracers in 'CFCTracers' category

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_use_CFCTracers_interior_restoring" type="logical"
category="tracer_forcing_CFCTracers" group="tracer_forcing_CFCTracers">
if true, interior restoring source is applied to tracers in 'CFCTracers' category

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_use_CFCTracers_exponential_decay" type="logical"
category="tracer_forcing_CFCTracers" group="tracer_forcing_CFCTracers">
if true, exponential decay source is applied to tracers in 'CFCTracers' category

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_use_CFCTracers_idealAge_forcing" type="logical"
category="tracer_forcing_CFCTracers" group="tracer_forcing_CFCTracers">
if true, idealAge forcing source is applied to tracers in 'CFCTracers' category

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_use_CFCTracers_ttd_forcing" type="logical"
category="tracer_forcing_CFCTracers" group="tracer_forcing_CFCTracers">
if true, transit time distribution forcing source is applied to tracers in 'CFCTracers' category

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_use_CFC11" type="logical"
category="tracer_forcing_CFCTracers" group="tracer_forcing_CFCTracers">
if true, CFC11 tracer is enabled for the run

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_use_CFC12" type="logical"
category="tracer_forcing_CFCTracers" group="tracer_forcing_CFCTracers">
if true, CFC12 tracer is enabled for the run

Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<!-- AM_globalStats -->

Expand Down
54 changes: 53 additions & 1 deletion components/mpas-ocean/driver/ocn_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module ocn_comp_mct
use ocn_tracer_short_wave_absorption
use ocn_tracer_short_wave_absorption_variable
use ocn_tracer_ecosys
use ocn_tracer_CFC
use ocn_tracer_surface_restoring
use ocn_gm
use ocn_config
Expand Down Expand Up @@ -199,6 +200,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )!{{{
character(len=StrKIND), pointer :: tempCharConfig

logical, pointer :: config_use_ecosysTracers
logical, pointer :: config_use_CFCTracers
logical, pointer :: config_use_activeTracers_surface_restoring
logical, pointer :: config_use_surface_salinity_monthly_restoring
character (len=StrKIND), pointer :: config_land_ice_flux_mode
Expand Down Expand Up @@ -699,6 +701,14 @@ end subroutine xml_stream_get_attributes
call mpas_timer_stop('io_ecosys')
endif

! read initial data required for CFC forcing
call mpas_pool_get_config(domain % configs, 'config_use_CFCTracers', config_use_CFCTracers)
if (config_use_CFCTracers) then
call mpas_timer_start('io_CFC',.false.)
call ocn_get_CFCData(domain_ptr % streamManager, domain, domain % clock, .true.)
call mpas_timer_stop('io_CFC')
endif

! read initial data required for monthly surface salinity restoring
call mpas_pool_get_config(domain % configs, 'config_use_activeTracers_surface_restoring', &
config_use_activeTracers_surface_restoring)
Expand Down Expand Up @@ -875,6 +885,7 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)!{{{
logical :: streamActive, debugOn
logical, pointer :: config_write_output_on_startup
logical, pointer :: config_use_ecosysTracers
logical, pointer :: config_use_CFCTracers
logical, pointer :: config_use_activeTracers_surface_restoring
logical, pointer :: config_use_surface_salinity_monthly_restoring
character (len=StrKIND), pointer :: config_restart_timestamp_name
Expand Down Expand Up @@ -987,6 +998,14 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)!{{{
call mpas_timer_stop('io_ecosys')
endif

! read next time level data required for CFC forcing
call mpas_pool_get_config(domain % configs, 'config_use_CFCTracers', config_use_CFCTracers)
if (config_use_CFCTracers) then
call mpas_timer_start('io_CFC',.false.)
call ocn_get_CFCData(domain % streamManager, domain, domain_ptr % clock, .false.)
call mpas_timer_stop('io_CFC')
endif

! read next time level data required for monthly surface salinity restoring
call mpas_pool_get_config(domain % configs, 'config_use_activeTracers_surface_restoring', &
config_use_activeTracers_surface_restoring)
Expand Down Expand Up @@ -1105,6 +1124,8 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)!{{{

if (config_use_ecosysTracers) call ocn_ecosys_forcing_write_restart(domain_ptr)

if (config_use_CFCTracers) call ocn_CFC_forcing_write_restart(domain_ptr)

if (config_use_activeTracers_surface_restoring .and. config_use_surface_salinity_monthly_restoring) &
call ocn_salinity_restoring_forcing_write_restart(domain_ptr)
! Write a restart file, because the coupler asked for it.
Expand Down Expand Up @@ -1572,6 +1593,7 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
config_use_DMSTracers_sea_ice_coupling, &
config_use_MacroMoleculesTracers, &
config_use_MacroMoleculesTracers_sea_ice_coupling, &
config_use_CFCTracers, &
config_remove_AIS_coupler_runoff, &
config_cvmix_kpp_use_theory_wave

Expand All @@ -1591,7 +1613,8 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
ecosysAuxiliary, &
ecosysSeaIceCoupling, &
DMSSeaIceCoupling, &
MacroMoleculesSeaIceCoupling
MacroMoleculesSeaIceCoupling, &
CFCAuxiliary

integer, pointer :: nCellsSolve

Expand Down Expand Up @@ -1652,6 +1675,7 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
atmosphericPressure, iceFraction, &
seaIcePressure, windSpeedSquared10m, &
atmosphericCO2, atmosphericCO2_ALT_CO2, &
windSpeedSquared10mCFC, &
iceFluxDIC, &
iceFluxDON, &
iceFluxNO3, &
Expand Down Expand Up @@ -1717,6 +1741,7 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
config_use_DMSTracers_sea_ice_coupling)
call mpas_pool_get_config(domain % configs, 'config_use_MacroMoleculesTracers_sea_ice_coupling', &
config_use_MacroMoleculesTracers_sea_ice_coupling)
call mpas_pool_get_config(domain % configs, 'config_use_CFCTracers', config_use_CFCTracers)
call mpas_pool_get_config(domain % configs, 'config_remove_AIS_coupler_runoff', config_remove_AIS_coupler_runoff)
call mpas_pool_get_config(domain % configs, 'config_cvmix_kpp_use_theory_wave', config_cvmix_kpp_use_theory_wave)

Expand Down Expand Up @@ -1877,6 +1902,13 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
iceFluxDMSP => iceFluxDMSPField % array
endif

! CFC fields
if (config_use_CFCTracers) then
call mpas_pool_get_subpool(forcingPool, 'CFCAuxiliary', CFCAuxiliary)
call mpas_pool_get_field(CFCAuxiliary, 'windSpeedSquared10mCFC', windSpeedSquared10mField)
windSpeedSquared10mCFC => windSpeedSquared10mField % array
endif

if (config_remove_AIS_coupler_runoff) then
! Initialize these fields
removedRiverRunoffFlux(:) = 0.0_RKIND
Expand Down Expand Up @@ -2107,6 +2139,13 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
endif
endif

! CFC fields
if (config_use_CFCTracers) then
if ( windSpeedSquared10mField % isActive ) then
windSpeedSquared10mCFC(i) = x2o_o % rAttr(index_x2o_So_duu10n, n)
end if
end if

end do

block_ptr => block_ptr % next
Expand Down Expand Up @@ -2189,6 +2228,12 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
call mpas_pool_get_field(DMSSeaIceCoupling, 'iceFluxDMSP', iceFluxDMSPField)
endif

! CFC fields
if (config_use_CFCTracers) then
call mpas_pool_get_subpool(forcingPool, 'CFCAuxiliary', CFCAuxiliary)
call mpas_pool_get_field(CFCAuxiliary, 'windSpeedSquared10mCFC', windSpeedSquared10mField)
endif

if ( windStressMeridionalField % isActive ) then
call mpas_dmpar_exch_halo_field(windStressMeridionalField)
end if
Expand Down Expand Up @@ -2358,6 +2403,13 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
endif
endif

! CFC fields
if (config_use_CFCTracers .and. .not. config_use_ecosysTracers) then
if ( windSpeedSquared10mField % isActive ) then
call mpas_dmpar_exch_halo_field(windSpeedSquared10mField)
end if
endif

! global sum of removed runoff
if (config_remove_AIS_coupler_runoff) then
call MPAS_dmpar_sum_real(domain % dminfo, removedRiverRunoffFluxThisProc, removedRiverRunoffFluxReduced)
Expand Down
17 changes: 17 additions & 0 deletions components/mpas-ocean/src/mode_forward/mpas_ocn_forward_mode.F
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ module ocn_forward_mode
use ocn_tracer_DMS
use ocn_tracer_MacroMolecules
use ocn_tracer_ideal_age
use ocn_tracer_CFC
use ocn_tracer_surface_restoring
use ocn_gm

Expand Down Expand Up @@ -442,6 +443,8 @@ function ocn_forward_mode_init(domain, startTimeStamp) result(ierr)!{{{
ierr = ior(ierr,err_tmp)
call ocn_tracer_ideal_age_init(domain, err_tmp)
ierr = ior(ierr,err_tmp)
call ocn_tracer_CFC_init(domain, err_tmp)
ierr = ior(ierr,err_tmp)
if (ierr /= 0) then
call mpas_log_write( &
'Error initializing tracer tendency modules', &
Expand Down Expand Up @@ -595,6 +598,13 @@ function ocn_forward_mode_run(domain) result(ierr)!{{{
call mpas_timer_stop('io_ecosys')
endif

! read initial data required for CFC forcing
if (config_use_CFCTracers) then
call mpas_timer_start('io_CFC',.false.)
call ocn_get_CFCData(domain % streamManager, domain, domain % clock, .true.)
call mpas_timer_stop('io_CFC')
endif

! read initial data required for monthly surface salinity restoring
! always execute this call as initial data needed regardless of alarm
if (config_use_activeTracers_surface_restoring .and. config_use_surface_salinity_monthly_restoring) then
Expand Down Expand Up @@ -740,6 +750,13 @@ function ocn_forward_mode_run(domain) result(ierr)!{{{
call mpas_timer_stop('io_ecosys')
endif

! read next time level data required for CFC forcing
if (config_use_CFCTracers) then
call mpas_timer_start('io_CFC',.false.)
call ocn_get_CFCData(domain % streamManager, domain, domain % clock, .false.)
call mpas_timer_stop('io_CFC')
endif

! read next time level data required for monthly surface salinity restoring
if (config_use_activeTracers_surface_restoring .and. config_use_surface_salinity_monthly_restoring) then
if ( mpas_is_alarm_ringing(domain % clock, 'salinityDataReadAlarm', ierr=err_tmp) ) then
Expand Down
1 change: 1 addition & 0 deletions components/mpas-ocean/src/ocean.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ list(APPEND RAW_SOURCES
core_ocean/shared/mpas_ocn_tracer_interior_restoring.F
core_ocean/shared/mpas_ocn_tracer_exponential_decay.F
core_ocean/shared/mpas_ocn_tracer_ideal_age.F
core_ocean/shared/mpas_ocn_tracer_CFC.F
core_ocean/shared/mpas_ocn_tracer_TTD.F
core_ocean/shared/mpas_ocn_tracer_ecosys.F
core_ocean/shared/mpas_ocn_tracer_DMS.F
Expand Down
5 changes: 4 additions & 1 deletion components/mpas-ocean/src/shared/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ OBJS = mpas_ocn_init_routines.o \
mpas_ocn_tracer_ecosys.o \
mpas_ocn_tracer_DMS.o \
mpas_ocn_tracer_MacroMolecules.o \
mpas_ocn_tracer_CFC.o \
mpas_ocn_high_freq_thickness_hmix_del2.o \
mpas_ocn_tracer_surface_flux_to_tend.o \
mpas_ocn_test.o \
Expand All @@ -76,7 +77,7 @@ all: $(OBJS)

mpas_ocn_init_routines.o: mpas_ocn_constants.o mpas_ocn_config.o mpas_ocn_diagnostics.o mpas_ocn_gm.o mpas_ocn_forcing.o mpas_ocn_surface_land_ice_fluxes.o

mpas_ocn_tendency.o: mpas_ocn_high_freq_thickness_hmix_del2.o mpas_ocn_tracer_surface_restoring.o mpas_ocn_thick_surface_flux.o mpas_ocn_tracer_short_wave_absorption.o mpas_ocn_tracer_advection.o mpas_ocn_tracer_hmix.o mpas_ocn_tracer_nonlocalflux.o mpas_ocn_surface_bulk_forcing.o mpas_ocn_surface_land_ice_fluxes.o mpas_ocn_tracer_surface_flux_to_tend.o mpas_ocn_tracer_interior_restoring.o mpas_ocn_tracer_exponential_decay.o mpas_ocn_tracer_ideal_age.o mpas_ocn_tracer_TTD.o mpas_ocn_vmix.o mpas_ocn_constants.o mpas_ocn_config.o mpas_ocn_frazil_forcing.o mpas_ocn_tidal_forcing.o mpas_ocn_tracer_ecosys.o mpas_ocn_tracer_DMS.o mpas_ocn_tracer_MacroMolecules.o mpas_ocn_diagnostics.o mpas_ocn_wetting_drying.o mpas_ocn_tidal_potential_forcing.o mpas_ocn_vel_tidal_potential.o mpas_ocn_mesh.o
mpas_ocn_tendency.o: mpas_ocn_high_freq_thickness_hmix_del2.o mpas_ocn_tracer_surface_restoring.o mpas_ocn_thick_surface_flux.o mpas_ocn_tracer_short_wave_absorption.o mpas_ocn_tracer_advection.o mpas_ocn_tracer_hmix.o mpas_ocn_tracer_nonlocalflux.o mpas_ocn_surface_bulk_forcing.o mpas_ocn_surface_land_ice_fluxes.o mpas_ocn_tracer_surface_flux_to_tend.o mpas_ocn_tracer_interior_restoring.o mpas_ocn_tracer_exponential_decay.o mpas_ocn_tracer_ideal_age.o mpas_ocn_tracer_TTD.o mpas_ocn_vmix.o mpas_ocn_constants.o mpas_ocn_config.o mpas_ocn_frazil_forcing.o mpas_ocn_tidal_forcing.o mpas_ocn_tracer_ecosys.o mpas_ocn_tracer_DMS.o mpas_ocn_tracer_MacroMolecules.o mpas_ocn_tracer_CFC.o mpas_ocn_diagnostics.o mpas_ocn_wetting_drying.o mpas_ocn_tidal_potential_forcing.o mpas_ocn_vel_tidal_potential.o mpas_ocn_mesh.o

mpas_ocn_diagnostics.o: mpas_ocn_thick_ale.o mpas_ocn_equation_of_state.o mpas_ocn_gm.o mpas_ocn_constants.o mpas_ocn_config.o mpas_ocn_mesh.o mpas_ocn_diagnostics_variables.o mpas_ocn_surface_land_ice_fluxes.o

Expand Down Expand Up @@ -200,6 +201,8 @@ mpas_ocn_tracer_DMS.o: mpas_ocn_constants.o mpas_ocn_config.o

mpas_ocn_tracer_MacroMolecules.o: mpas_ocn_constants.o mpas_ocn_config.o

mpas_ocn_tracer_CFC.o: mpas_ocn_constants.o mpas_ocn_config.o

mpas_ocn_tracer_surface_flux_to_tend.o: mpas_ocn_constants.o mpas_ocn_config.o

mpas_ocn_time_average_coupled.o: mpas_ocn_constants.o mpas_ocn_config.o
Expand Down
Loading