Skip to content

Commit df39ad8

Browse files
committed
Address recent review to make carbon exchange configurable
- Nothing will be allocated/avaliable unless a parameter is set in overrides # Allow Carbon Runoff diagnostics #override ALLOW_CARBON_FLUX_EXCHANGE = True
1 parent efe9262 commit df39ad8

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ module MOM_surface_forcing_gfdl
109109
real :: rigid_sea_ice_mass !< A mass per unit area of sea-ice beyond which sea-ice viscosity
110110
!! becomes effective [R Z ~> kg m-2], typically of order 1000 kg m-2.
111111
logical :: allow_flux_adjustments !< If true, use data_override to obtain flux adjustments
112+
logical :: allow_carbon_flux_exchange !< If true, allows fluxes and diagnostics of carbon in runoff.
112113

113114
logical :: restore_salt !< If true, the coupled MOM driver adds a term to restore surface
114115
!! salinity to a specified value.
@@ -288,7 +289,8 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
288289
! flux type has been used.
289290
if (fluxes%dt_buoy_accum < 0) then
290291
call allocate_forcing_type(G, fluxes, water=.true., heat=.true., ustar=.not.CS%nonBous, press=.true., &
291-
fix_accum_bug=.not.CS%ustar_gustless_bug, tau_mag=CS%nonBous, carbon=.true.)
292+
fix_accum_bug=.not.CS%ustar_gustless_bug, tau_mag=CS%nonBous,&
293+
carbon=CS%allow_carbon_flux_exchange)
292294

293295
call safe_alloc_ptr(fluxes%sw_vis_dir,isd,ied,jsd,jed)
294296
call safe_alloc_ptr(fluxes%sw_vis_dif,isd,ied,jsd,jed)
@@ -504,7 +506,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
504506
call check_mask_val_consistency(IOB%runoff_hflx(i-i0,j-j0), G%mask2dT(i,j), i, j, 'runoff_hflx', G)
505507
endif
506508

507-
if (associated(IOB%runoff_carbon)) then
509+
if (associated(IOB%runoff_carbon) .and. CS%allow_carbon_flux_exchange) then
508510
fluxes%carbon_content_lrunoff(i,j) = US%kg_m2s_to_RZ_T * IOB%runoff_carbon(i-i0,j-j0) * G%mask2dT(i,j)
509511
if (CS%check_no_land_fluxes) &
510512
call check_mask_val_consistency(IOB%runoff_carbon(i-i0,j-j0), G%mask2dT(i,j), i, j, 'runoff_carbon', G)
@@ -1341,7 +1343,6 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, wind_stagger)
13411343
logical :: new_sim ! False if this simulation was started from a restart file
13421344
! or other equivalent files.
13431345
logical :: iceberg_flux_diags ! If true, diagnostics of fluxes from icebergs are available.
1344-
logical :: carbon_runoff_diags ! If true, diagnostics of fluxes of carbon from runoff are available.
13451346
logical :: fix_ustar_gustless_bug ! If false, include a bug using an older run-time parameter.
13461347
logical :: test_value ! This is used to determine whether a logical parameter is being set explicitly.
13471348
logical :: explicit_bug, explicit_fix ! These indicate which parameters are set explicitly.
@@ -1714,12 +1715,12 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, wind_stagger)
17141715
call get_param(param_file, mdl, "ALLOW_ICEBERG_FLUX_DIAGNOSTICS", iceberg_flux_diags, &
17151716
"If true, makes available diagnostics of fluxes from icebergs "//&
17161717
"as seen by MOM6.", default=.false.)
1717-
call get_param(param_file, mdl, "ALLOW_CARBON_FLUX_DIAGNOSTICS", carbon_runoff_diags, &
1718-
"If true, makes available diagnostics of fluxes of carbon in runoff "//&
1719-
"as seen by MOM6.", default=.false.)
1718+
call get_param(param_file, mdl, "ALLOW_CARBON_FLUX_EXCHANGE", CS%allow_carbon_flux_exchange, &
1719+
"If true, makes available fluxes and diagnostics of carbon in runoff "//&
1720+
"within MOM6.", default=.false.)
17201721
call register_forcing_type_diags(Time, diag, US, CS%use_temperature, CS%handles, &
17211722
use_berg_fluxes=iceberg_flux_diags, &
1722-
use_carbon_runoff=carbon_runoff_diags)
1723+
use_carbon_runoff=CS%allow_carbon_flux_exchange)
17231724

17241725
call get_param(param_file, mdl, "ALLOW_FLUX_ADJUSTMENTS", CS%allow_flux_adjustments, &
17251726
"If true, allows flux adjustments to specified via the "//&

src/core/MOM_forcing_type.F90

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3510,9 +3510,7 @@ subroutine allocate_forcing_by_group(G, fluxes, water, heat, ustar, press, &
35103510
call myAlloc(fluxes%latent_frunoff_glc_diag,isd,ied,jsd,jed, heat)
35113511

35123512
call myAlloc(fluxes%salt_flux,isd,ied,jsd,jed, salt)
3513-
if (present(carbon)) then ; if (carbon) then
3514-
call myAlloc(fluxes%carbon_content_lrunoff,isd,ied,jsd,jed, .true.)
3515-
endif ; endif
3513+
call myAlloc(fluxes%carbon_content_lrunoff,isd,ied,jsd,jed, carbon)
35163514

35173515
if (present(heat) .and. present(water)) then ; if (heat .and. water) then
35183516
call myAlloc(fluxes%heat_content_cond,isd,ied,jsd,jed, .true.)

0 commit comments

Comments
 (0)