Skip to content

Commit 67e806a

Browse files
nikizadehgfdlHallberg-NOAA
authored andcommitted
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 d0a956a commit 67e806a

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
@@ -111,6 +111,7 @@ module MOM_surface_forcing_gfdl
111111
real :: rigid_sea_ice_mass !< A mass per unit area of sea-ice beyond which sea-ice viscosity
112112
!! becomes effective [R Z ~> kg m-2], typically of order 1000 kg m-2.
113113
logical :: allow_flux_adjustments !< If true, use data_override to obtain flux adjustments
114+
logical :: allow_carbon_flux_exchange !< If true, allows fluxes and diagnostics of carbon in runoff.
114115

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

295297
call safe_alloc_ptr(fluxes%sw_vis_dir,isd,ied,jsd,jed)
296298
call safe_alloc_ptr(fluxes%sw_vis_dif,isd,ied,jsd,jed)
@@ -506,7 +508,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
506508
call check_mask_val_consistency(IOB%runoff_hflx(i-i0,j-j0), G%mask2dT(i,j), i, j, 'runoff_hflx', G)
507509
endif
508510

509-
if (associated(IOB%runoff_carbon)) then
511+
if (associated(IOB%runoff_carbon) .and. CS%allow_carbon_flux_exchange) then
510512
fluxes%carbon_content_lrunoff(i,j) = US%kg_m2s_to_RZ_T * IOB%runoff_carbon(i-i0,j-j0) * G%mask2dT(i,j)
511513
if (CS%check_no_land_fluxes) &
512514
call check_mask_val_consistency(IOB%runoff_carbon(i-i0,j-j0), G%mask2dT(i,j), i, j, 'runoff_carbon', G)
@@ -1343,7 +1345,6 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, wind_stagger)
13431345
logical :: new_sim ! False if this simulation was started from a restart file
13441346
! or other equivalent files.
13451347
logical :: iceberg_flux_diags ! If true, diagnostics of fluxes from icebergs are available.
1346-
logical :: carbon_runoff_diags ! If true, diagnostics of fluxes of carbon from runoff are available.
13471348
logical :: fix_ustar_gustless_bug ! If false, include a bug using an older run-time parameter.
13481349
logical :: test_value ! This is used to determine whether a logical parameter is being set explicitly.
13491350
logical :: explicit_bug, explicit_fix ! These indicate which parameters are set explicitly.
@@ -1716,12 +1717,12 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, wind_stagger)
17161717
call get_param(param_file, mdl, "ALLOW_ICEBERG_FLUX_DIAGNOSTICS", iceberg_flux_diags, &
17171718
"If true, makes available diagnostics of fluxes from icebergs "//&
17181719
"as seen by MOM6.", default=.false.)
1719-
call get_param(param_file, mdl, "ALLOW_CARBON_FLUX_DIAGNOSTICS", carbon_runoff_diags, &
1720-
"If true, makes available diagnostics of fluxes of carbon in runoff "//&
1721-
"as seen by MOM6.", default=.false.)
1720+
call get_param(param_file, mdl, "ALLOW_CARBON_FLUX_EXCHANGE", CS%allow_carbon_flux_exchange, &
1721+
"If true, makes available fluxes and diagnostics of carbon in runoff "//&
1722+
"within MOM6.", default=.false.)
17221723
call register_forcing_type_diags(Time, diag, US, CS%use_temperature, CS%handles, &
17231724
use_berg_fluxes=iceberg_flux_diags, &
1724-
use_carbon_runoff=carbon_runoff_diags)
1725+
use_carbon_runoff=CS%allow_carbon_flux_exchange)
17251726

17261727
call get_param(param_file, mdl, "ALLOW_FLUX_ADJUSTMENTS", CS%allow_flux_adjustments, &
17271728
"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
@@ -3512,9 +3512,7 @@ subroutine allocate_forcing_by_group(G, fluxes, water, heat, ustar, press, &
35123512
call myAlloc(fluxes%latent_frunoff_glc_diag,isd,ied,jsd,jed, heat)
35133513

35143514
call myAlloc(fluxes%salt_flux,isd,ied,jsd,jed, salt)
3515-
if (present(carbon)) then ; if (carbon) then
3516-
call myAlloc(fluxes%carbon_content_lrunoff,isd,ied,jsd,jed, .true.)
3517-
endif ; endif
3515+
call myAlloc(fluxes%carbon_content_lrunoff,isd,ied,jsd,jed, carbon)
35183516

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

0 commit comments

Comments
 (0)