Skip to content

Commit 8e36568

Browse files
Merge pull request #3 from jkrasting/mc_blres_tracer
Updates for boundary layer residence time tracer and flexible gas params
2 parents 8dda39f + df5c3d8 commit 8e36568

File tree

8 files changed

+1070
-458
lines changed

8 files changed

+1070
-458
lines changed

generic_tracers/generic_BLING.F90

Lines changed: 142 additions & 85 deletions
Large diffs are not rendered by default.

generic_tracers/generic_CFC.F90

Lines changed: 207 additions & 151 deletions
Large diffs are not rendered by default.

generic_tracers/generic_COBALT.F90

Lines changed: 74 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ module generic_COBALT
146146
use g_tracer_utils, only : g_tracer_get_values
147147
use g_tracer_utils, only : g_diag_type, g_diag_field_add
148148
use g_tracer_utils, only : register_diag_field=>g_register_diag_field
149-
use g_tracer_utils, only : g_send_data
149+
use g_tracer_utils, only : g_send_data, is_root_pe
150150

151151
use FMS_ocmip2_co2calc_mod, only : FMS_ocmip2_co2calc, CO2_dope_vector
152152

@@ -168,9 +168,12 @@ module generic_COBALT
168168
public generic_COBALT_update_from_bottom
169169
public generic_COBALT_set_boundary_values
170170
public generic_COBALT_end
171+
public as_param_cobalt
171172

172-
!The following logical for using this module is overwritten
173+
!The following variables for using this module
174+
! are overwritten by generic_tracer_nml namelist
173175
logical, save :: do_generic_COBALT = .false.
176+
character(len=10), save :: as_param_cobalt = 'gfdl_cmip6'
174177

175178
real, parameter :: sperd = 24.0 * 3600.0
176179
real, parameter :: spery = 365.25 * sperd
@@ -646,8 +649,8 @@ module generic_COBALT
646649

647650
real :: htotal_scale_lo, htotal_scale_hi, htotal_in
648651
real :: Rho_0, a_0, a_1, a_2, a_3, a_4, a_5, b_0, b_1, b_2, b_3, c_0
649-
real :: a1_co2, a2_co2, a3_co2, a4_co2, a1_o2, a2_o2, a3_o2, a4_o2
650-
real :: sA_co2, sB_co2, sC_co2, sD_co2, sE_co2, sA_o2, sB_o2, sC_o2, sD_o2, sE_o2
652+
real :: a1_co2, a2_co2, a3_co2, a4_co2, a5_co2
653+
real :: a1_o2, a2_o2, a3_o2, a4_o2, a5_o2
651654

652655
logical, dimension(:,:), ALLOCATABLE :: &
653656
mask_z_sat_arag,&
@@ -5203,45 +5206,45 @@ subroutine user_add_params
52035206
!-----------------------------------------------------------------------
52045207
! Schmidt number coefficients
52055208
!-----------------------------------------------------------------------
5206-
!
5207-
! Compute the Schmidt number of CO2 in seawater using the
5208-
! formulation presented by Wanninkhof (1992, J. Geophys. Res., 97,
5209-
! 7373-7382).
5210-
! 2018/01/17 jgj update Schmidt numbers for CO2 to
5211-
! Wanninkhof, Limnol. Oceanogr: Methods, 12, 2014, 351-362
5212-
!-----------------------------------------------------------------------
5213-
!New Wanninkhof numbers
5214-
!call g_tracer_add_param('a1_co2', cobalt%a1_co2, 2068.9)
5215-
!call g_tracer_add_param('a2_co2', cobalt%a2_co2, -118.63)
5216-
!call g_tracer_add_param('a3_co2', cobalt%a3_co2, 2.9311)
5217-
!call g_tracer_add_param('a4_co2', cobalt%a4_co2, -0.027)
5218-
!
5219-
!New Wanninkhof 2014 numbers
5220-
call g_tracer_add_param('sA_co2', cobalt%sA_co2, 2116.8)
5221-
call g_tracer_add_param('sB_co2', cobalt%sB_co2, -136.25)
5222-
call g_tracer_add_param('sC_co2', cobalt%sC_co2, 4.7353)
5223-
call g_tracer_add_param('sD_co2', cobalt%sD_co2, -0.092307)
5224-
call g_tracer_add_param('sE_co2', cobalt%sE_co2, 0.0007555)
5225-
!---------------------------------------------------------------------
5226-
! Compute the Schmidt number of O2 in seawater using the
5227-
! formulation proposed by Keeling et al. (1998, Global Biogeochem.
5228-
! Cycles, 12, 141-163).
5229-
! 2018/01/17 jgj update Schmidt numbers for O2 to
5230-
! Wanninkhof, Limnol. Oceanogr: Methods, 12, 2014, 351-362
5231-
!---------------------------------------------------------------------
5232-
!New Wanninkhof numbers
5233-
!call g_tracer_add_param('a1_o2', cobalt%a1_o2, 1929.7)
5234-
!call g_tracer_add_param('a2_o2', cobalt%a2_o2, -117.46)
5235-
!call g_tracer_add_param('a3_o2', cobalt%a3_o2, 3.116)
5236-
!call g_tracer_add_param('a4_o2', cobalt%a4_o2, -0.0306)
5237-
!
5238-
!New Wanninkhof 2014 numbers
5239-
call g_tracer_add_param('sA_o2', cobalt%sA_o2, 1920.4)
5240-
call g_tracer_add_param('sB_o2', cobalt%sB_o2, -135.6)
5241-
call g_tracer_add_param('sC_o2', cobalt%sC_o2, 5.2122)
5242-
call g_tracer_add_param('sD_o2', cobalt%sD_o2, -0.10939)
5243-
call g_tracer_add_param('sE_o2', cobalt%sE_o2, 0.00093777)
5244-
!
5209+
if (trim(as_param_cobalt) == 'W92') then
5210+
! Compute the Schmidt number of CO2 in seawater using the
5211+
! formulation presented by Wanninkhof (1992, J. Geophys. Res., 97,
5212+
! 7373-7382).
5213+
call g_tracer_add_param('a1_co2', cobalt%a1_co2, 2068.9)
5214+
call g_tracer_add_param('a2_co2', cobalt%a2_co2, -118.63)
5215+
call g_tracer_add_param('a3_co2', cobalt%a3_co2, 2.9311)
5216+
call g_tracer_add_param('a4_co2', cobalt%a4_co2, -0.027)
5217+
call g_tracer_add_param('a5_co2', cobalt%a5_co2, 0.0) ! Not used for W92
5218+
! Compute the Schmidt number of O2 in seawater using the
5219+
! formulation proposed by Keeling et al. (1998, Global Biogeochem.
5220+
! Cycles, 12, 141-163).
5221+
call g_tracer_add_param('a1_o2', cobalt%a1_o2, 1929.7)
5222+
call g_tracer_add_param('a2_o2', cobalt%a2_o2, -117.46)
5223+
call g_tracer_add_param('a3_o2', cobalt%a3_o2, 3.116)
5224+
call g_tracer_add_param('a4_o2', cobalt%a4_o2, -0.0306)
5225+
call g_tracer_add_param('a5_o2', cobalt%a5_o2, 0.0) ! Not used for W92
5226+
if (is_root_pe()) call mpp_error(NOTE,'generic_cobalt: Using Schmidt number coefficients for W92')
5227+
else if ((trim(as_param_cobalt) == 'W14') .or. (trim(as_param_cobalt) == 'gfdl_cmip6')) then
5228+
! Compute the Schmidt number of CO2 in seawater using the
5229+
! formulation presented by Wanninkhof
5230+
! (2014, Limnol. Oceanogr., 12, 351-362)
5231+
call g_tracer_add_param('a1_co2', cobalt%a1_co2, 2116.8)
5232+
call g_tracer_add_param('a2_co2', cobalt%a2_co2, -136.25)
5233+
call g_tracer_add_param('a3_co2', cobalt%a3_co2, 4.7353)
5234+
call g_tracer_add_param('a4_co2', cobalt%a4_co2, -0.092307)
5235+
call g_tracer_add_param('a5_co2', cobalt%a5_co2, 0.0007555)
5236+
! Compute the Schmidt number of O2 in seawater using the
5237+
! formulation presented by Wanninkhof
5238+
! (2014, Limnol. Oceanogr., 12, 351-362)
5239+
call g_tracer_add_param('a1_o2', cobalt%a1_o2, 1920.4)
5240+
call g_tracer_add_param('a2_o2', cobalt%a2_o2, -135.6)
5241+
call g_tracer_add_param('a3_o2', cobalt%a3_o2, 5.2122)
5242+
call g_tracer_add_param('a4_o2', cobalt%a4_o2, -0.10939)
5243+
call g_tracer_add_param('a5_o2', cobalt%a5_o2, 0.00093777)
5244+
if (is_root_pe()) call mpp_error(NOTE,'generic_cobalt: Using Schmidt number coefficients for W14')
5245+
else
5246+
call mpp_error(FATAL,'generic_cobalt: unable to set Schmidt number coefficients for as_param '//trim(as_param_cobalt))
5247+
endif
52455248
!-----------------------------------------------------------------------
52465249
! Stoichiometry
52475250
!-----------------------------------------------------------------------
@@ -5640,9 +5643,17 @@ end subroutine user_add_params
56405643

56415644
subroutine user_add_tracers(tracer_list)
56425645
type(g_tracer_type), pointer :: tracer_list
5643-
5644-
56455646
character(len=fm_string_len), parameter :: sub_name = 'user_add_tracers'
5647+
real :: as_coeff_cobalt
5648+
5649+
if ((trim(as_param_cobalt) == 'W92') .or. (trim(as_param_cobalt) == 'gfdl_cmip6')) then
5650+
! Air-sea gas exchange coefficient presented in OCMIP2 protocol.
5651+
! Value is 0.337 cm/hr in units of m/s.
5652+
as_coeff_cobalt=9.36e-7
5653+
else
5654+
! Value is 0.251 cm/hr in units of m/s
5655+
as_coeff_cobalt=6.972e-7
5656+
endif
56465657

56475658
!
56485659
!Add here only the parameters that are required at the time of registeration
@@ -5731,7 +5742,7 @@ subroutine user_add_tracers(tracer_list)
57315742
flux_gas_name = 'co2_flux', &
57325743
flux_gas_type = 'air_sea_gas_flux_generic', &
57335744
flux_gas_molwt = WTMCO2, &
5734-
flux_gas_param = (/ 9.36e-07, 9.7561e-06 /), &
5745+
flux_gas_param = (/ as_coeff_cobalt, 9.7561e-06 /), &
57355746
! Uncomment for "no mass change" check
57365747
! flux_gas_param = (/ 0.0, 0.0 /), &
57375748
flux_gas_restart_file = 'ocean_cobalt_airsea_flux.res.nc', &
@@ -5942,8 +5953,8 @@ subroutine user_add_tracers(tracer_list)
59425953
flux_gas_name = 'o2_flux', &
59435954
flux_gas_type = 'air_sea_gas_flux_generic', &
59445955
flux_gas_molwt = WTMO2, &
5945-
flux_gas_param = (/ 9.36e-07, 9.7561e-06 /), &
5946-
flux_gas_restart_file = 'ocean_cobalt_airsea_flux.res.nc', &
5956+
flux_gas_param = (/ as_coeff_cobalt, 9.7561e-06 /), &
5957+
flux_gas_restart_file = 'ocean_cobalt_airsea_flux.res.nc', &
59475958
flux_bottom= .true. )
59485959
!
59495960
! Pdet (Sinking detrital/particulate Phosphorus)
@@ -6075,7 +6086,7 @@ subroutine user_add_tracers(tracer_list)
60756086
flux_gas_name = 'c14o2_flux', &
60766087
flux_gas_type = 'air_sea_gas_flux', &
60776088
flux_gas_molwt = WTMCO2, &
6078-
flux_gas_param = (/ 9.36e-07, 9.7561e-06 /), &
6089+
flux_gas_param = (/ as_coeff_cobalt, 9.7561e-06 /), &
60796090
flux_gas_restart_file = 'ocean_cobalt_airsea_flux.res.nc', &
60806091
flux_runoff= .true., &
60816092
flux_param = (/14.e-03 /), &
@@ -12011,12 +12022,13 @@ subroutine generic_COBALT_set_boundary_values(tracer_list,SST,SSS,rho,ilb,jlb,ta
1201112022
! 2018/01/17 jgj update Schmidt number for CO2 to use
1201212023
! Wanninkhof, Limnol. Oceanogr: Methods, 12, 2014, 351-362
1201312024
!---------------------------------------------------------------------
12014-
!co2_sc_no(i,j) = cobalt%a1_co2 + ST * (cobalt%a2_co2 + ST * (cobalt%a3_co2 + ST * cobalt%a4_co2)) * &
12015-
! grid_tmask(i,j,1)
12016-
!
12017-
co2_sc_no(i,j) = cobalt%sA_co2 + ST * (cobalt%sB_co2 + ST * (cobalt%sC_co2 + ST * (cobalt%sD_co2 + &
12018-
ST * cobalt%sE_co2))) * grid_tmask(i,j,1)
12019-
12025+
if (trim(as_param_cobalt) == 'W92') then
12026+
co2_sc_no(i,j) = cobalt%a1_co2 + ST*(cobalt%a2_co2 + ST*(cobalt%a3_co2 + ST*cobalt%a4_co2)) * &
12027+
grid_tmask(i,j,1)
12028+
else if ((trim(as_param_cobalt) == 'W14') .or. (trim(as_param_cobalt) == 'gfdl_cmip6')) then
12029+
co2_sc_no(i,j) = cobalt%a1_co2 + ST*(cobalt%a2_co2 + ST*(cobalt%a3_co2 + &
12030+
ST*(cobalt%a4_co2 + ST*cobalt%a5_co2))) * grid_tmask(i,j,1)
12031+
endif
1202012032
! sc_no_term = sqrt(660.0 / (sc_co2 + epsln))
1202112033
!
1202212034
! co2_alpha(i,j) = co2_alpha(i,j)* sc_no_term * cobalt%Rho_0 !nnz: MOM has rho(i,j,1,tau)
@@ -12075,11 +12087,13 @@ subroutine generic_COBALT_set_boundary_values(tracer_list,SST,SSS,rho,ilb,jlb,ta
1207512087
! In 'ocmip2_generic' atmos_ocean_fluxes.F90 coupler formulation,
1207612088
! the schmidt number is carried in explicitly
1207712089
!
12078-
!o2_sc_no(i,j) = cobalt%a1_o2 + ST * (cobalt%a2_o2 + ST * (cobalt%a3_o2 + ST * cobalt%a4_o2 )) * &
12079-
! grid_tmask(i,j,1)
12080-
12081-
o2_sc_no(i,j) = cobalt%sA_o2 + ST * (cobalt%sB_o2 + ST * (cobalt%sC_o2 + ST * (cobalt%sD_o2 + &
12082-
ST * cobalt%sE_o2))) * grid_tmask(i,j,1)
12090+
if (trim(as_param_cobalt) == 'W92') then
12091+
o2_sc_no(i,j) = cobalt%a1_o2 + ST * (cobalt%a2_o2 + ST * (cobalt%a3_o2 + ST * cobalt%a4_o2 )) * &
12092+
grid_tmask(i,j,1)
12093+
else if ((trim(as_param_cobalt) == 'W14') .or. (trim(as_param_cobalt) == 'gfdl_cmip6')) then
12094+
o2_sc_no(i,j) = cobalt%a1_o2 + ST*(cobalt%a2_o2 + ST*(cobalt%a3_o2 + &
12095+
ST*(cobalt%a4_o2 + ST*cobalt%a5_o2))) * grid_tmask(i,j,1)
12096+
endif
1208312097
!
1208412098
! renormalize the alpha value for atm o2
1208512099
! data table override for o2_flux_pcair_atm is now set to 0.21

0 commit comments

Comments
 (0)