Skip to content

Commit 5402ce0

Browse files
committed
Address some comments from code review
1. Added variable descriptions and units to lots of variables 2. Fixed instances where units were [physical units ~> MOM6 unique units] instead of [MOM6 units ~> phys units]. Also switched notation for inverse units from things like "m/s" to "m s-1" and converted fluxes%qsw_cat to unique units. 3. Fixed several get_param() calls that did not include variable description or units 4. Had two sets of dummy arguments in register_MARBL_tracers for calling read_Z_edges() when the second call could just reuse the arguments from the first
1 parent a867971 commit 5402ce0

5 files changed

Lines changed: 61 additions & 57 deletions

File tree

config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,13 @@ module MOM_surface_forcing_nuopc
204204
real, pointer, dimension(:,:) :: seaice_dust_flux =>NULL() !< Dust flux from seaice [kg/m^2/s]
205205
real, pointer, dimension(:,:) :: atm_bc_flux =>NULL() !< Black carbon flux from atmosphere [kg/m^2/s]
206206
real, pointer, dimension(:,:) :: seaice_bc_flux =>NULL() !< Black carbon flux from seaice [kg/m^2/s]
207-
real, pointer, dimension(:,:) :: afracr =>NULL()
208-
real, pointer, dimension(:,:) :: swnet_afracr =>NULL()
209-
real, pointer, dimension(:,:,:) :: swpen_ifrac_n =>NULL()
210-
real, pointer, dimension(:,:,:) :: ifrac_n =>NULL()
207+
real, pointer, dimension(:,:) :: afracr =>NULL() !< Fractional atmosphere coverage wrt ocean [nondim]
208+
real, pointer, dimension(:,:) :: swnet_afracr =>NULL() !< Net shortwave radiation times atmosphere fraction
209+
!! positive => into the ocean [W/m^2]
210+
real, pointer, dimension(:,:,:) :: swpen_ifrac_n =>NULL() !< Net shortwave radiation penetrating into ice and
211+
!! ocean times ice fraction for thickness
212+
!! positive => into the ocean [W/m^2]
213+
real, pointer, dimension(:,:,:) :: ifrac_n =>NULL() !< Ice fraction per category [nondim]
211214
real, pointer, dimension(:,:) :: mi =>NULL() !< mass of ice [kg/m2]
212215
real, pointer, dimension(:,:) :: ice_rigidity =>NULL() !< rigidity of the sea ice, sea-ice and
213216
!! ice-shelves, expressed as a coefficient

config_src/drivers/solo_driver/MOM_surface_forcing.F90

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,13 +1562,13 @@ subroutine MARBL_forcing_from_data_override(fluxes, day, G, US, CS)
15621562
! Local variables
15631563
real, pointer, dimension(:,:) :: atm_co2_prog =>NULL() !< Prognostic atmospheric CO2 concentration [ppm]
15641564
real, pointer, dimension(:,:) :: atm_co2_diag =>NULL() !< Diagnostic atmospheric CO2 concentration [ppm]
1565-
real, pointer, dimension(:,:) :: atm_fine_dust_flux =>NULL() !< Fine dust flux from atmosphere [kg/m^2/s ~> RZ/T]
1566-
real, pointer, dimension(:,:) :: atm_coarse_dust_flux =>NULL() !< Coarse dust flux from atmosphere [kg/m^2/s ~> RZ/T]
1567-
real, pointer, dimension(:,:) :: seaice_dust_flux =>NULL() !< Dust flux from seaice [kg/m^2/s ~> RZ/T]
1568-
real, pointer, dimension(:,:) :: atm_bc_flux =>NULL() !< Black carbon flux from atmosphere [kg/m^2/s ~> RZ/T]
1569-
real, pointer, dimension(:,:) :: seaice_bc_flux =>NULL() !< Black carbon flux from seaice [kg/m^2/s ~> RZ/T]
1570-
real, pointer, dimension(:,:) :: nhx_dep =>NULL() !< Nitrogen deposition [kg/m^2/s ~> RZ/T]
1571-
real, pointer, dimension(:,:) :: noy_dep =>NULL() !< Nitrogen deposition [kg/m^2/s ~> RZ/T]
1565+
real, pointer, dimension(:,:) :: atm_fine_dust_flux =>NULL() !< Fine dust flux from atmosphere [R Z T-1 ~> kg m-2 s-1]
1566+
real, pointer, dimension(:,:) :: atm_coarse_dust_flux =>NULL() !< Coarse dust flux from atmosphere [R Z T-1 ~> kg m-2 s-1]
1567+
real, pointer, dimension(:,:) :: seaice_dust_flux =>NULL() !< Dust flux from seaice [R Z T-1 ~> kg m-2 s-1]
1568+
real, pointer, dimension(:,:) :: atm_bc_flux =>NULL() !< Black carbon flux from atmosphere [R Z T-1 ~> kg m-2 s-1]
1569+
real, pointer, dimension(:,:) :: seaice_bc_flux =>NULL() !< Black carbon flux from seaice [R Z T-1 ~> kg m-2 s-1]
1570+
real, pointer, dimension(:,:) :: nhx_dep =>NULL() !< Nitrogen deposition [R Z T-1 ~> kg m-2 s-1]
1571+
real, pointer, dimension(:,:) :: noy_dep =>NULL() !< Nitrogen deposition [R Z T-1 ~> kg m-2 s-1]
15721572
integer :: isc, iec, jsc, jec
15731573

15741574
! Necessary null pointers for arguments to convert_driver_fields_to_forcings()

src/core/MOM_forcing_type.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ module MOM_forcing_type
233233
iron_flux => NULL() !< Flux of dust into the ocean [conc Z T-1 ~> conc m s-1]
234234

235235
real, pointer, dimension(:,:,:) :: &
236-
fracr_cat => NULL(), & !< per-category ice fraction
237-
qsw_cat => NULL() !< per-category shortwave
236+
fracr_cat => NULL(), & !< per-category ice fraction [nondim]
237+
qsw_cat => NULL() !< per-category shortwave [Q R Z T-1 ~> W m-2]
238238

239239
real, pointer, dimension(:,:) :: &
240240
lamult => NULL() !< Langmuir enhancement factor [nondim]

src/tracer/MARBL_forcing_mod.F90

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ module MARBL_forcing_mod
3939
type(diag_ctrl), pointer :: diag => NULL() !< A structure that is used to
4040
!! regulate the timing of diagnostic output.
4141

42-
real :: dust_ratio_thres !< coarse/fine dust ratio threshold
43-
real :: dust_ratio_to_fe_bioavail_frac !< ratio of dust to iron bioavailability fraction
44-
real :: fe_bioavail_frac_offset !< offset for iron bioavailability fraction
45-
real :: atm_fe_to_bc_ratio !< atmospheric iron to black carbon ratio
46-
real :: atm_bc_fe_bioavail_frac !< atmospheric black carbon to iron bioavailablity fraction ratio
47-
real :: seaice_fe_to_bc_ratio !< sea-ice iron to black carbon ratio
48-
real :: seaice_bc_fe_bioavail_frac !< sea-ice black carbon to iron bioavailablity fraction ratio
49-
real :: iron_frac_in_atm_fine_dust !< Fraction of fine dust from the atmosphere that is iron
50-
real :: iron_frac_in_atm_coarse_dust !< Fraction of coarse dust from the atmosphere that is iron
51-
real :: iron_frac_in_seaice_dust !< Fraction of dust from the sea ice that is iron
42+
real :: dust_ratio_thres !< coarse/fine dust ratio threshold [1]
43+
real :: dust_ratio_to_fe_bioavail_frac !< ratio of dust to iron bioavailability fraction [1]
44+
real :: fe_bioavail_frac_offset !< offset for iron bioavailability fraction [1]
45+
real :: atm_fe_to_bc_ratio !< atmospheric iron to black carbon ratio [1]
46+
real :: atm_bc_fe_bioavail_frac !< atmospheric black carbon to iron bioavailablity fraction ratio [1]
47+
real :: seaice_fe_to_bc_ratio !< sea-ice iron to black carbon ratio [1]
48+
real :: seaice_bc_fe_bioavail_frac !< sea-ice black carbon to iron bioavailablity fraction ratio [1]
49+
real :: iron_frac_in_atm_fine_dust !< Fraction of fine dust from the atmosphere that is iron [1]
50+
real :: iron_frac_in_atm_coarse_dust !< Fraction of coarse dust from the atmosphere that is iron [1]
51+
real :: iron_frac_in_seaice_dust !< Fraction of dust from the sea ice that is iron [1]
5252
real :: atm_co2_const !< atmospheric CO2 (if specifying a constant value) [ppm]
5353
real :: atm_alt_co2_const !< alternate atmospheric CO2 for _ALT_CO2 tracers
5454
!! (if specifying a constant value) [ppm]
@@ -99,28 +99,25 @@ subroutine MARBL_forcing_init(G, US, param_file, diag, day, inputdir, use_marbl,
9999
endif
100100

101101
call get_param(param_file, mdl, "DUST_RATIO_THRES", CS%dust_ratio_thres, &
102-
"TODO: Add description", units="add_units", default=69.00594)
103-
call get_param(param_file, mdl, "DUST_RATIO_TO_FE_BIOAVAIL_FRAC", &
104-
CS%dust_ratio_to_fe_bioavail_frac, &
105-
"TODO: Add description", units="add_units", default=1./366.314)
102+
"coarse/fine dust ratio threshold", units="1", default=69.00594)
103+
call get_param(param_file, mdl, "DUST_RATIO_TO_FE_BIOAVAIL_FRAC", CS%dust_ratio_to_fe_bioavail_frac, &
104+
"ratio of dust to iron bioavailability fraction", units="1", default=1./366.314)
106105
call get_param(param_file, mdl, "FE_BIOAVAIL_FRAC_OFFSET", CS%fe_bioavail_frac_offset, &
107-
"TODO: Add description", units="add_units", default=0.0146756)
106+
"offset for iron bioavailability fraction", units="1", default=0.0146756)
108107
call get_param(param_file, mdl, "ATM_FE_TO_BC_RATIO", CS%atm_fe_to_bc_ratio, &
109-
"TODO: Add description", units="add_units", default=1.)
108+
"atmospheric iron to black carbon ratio", units="1", default=1.)
110109
call get_param(param_file, mdl, "ATM_BC_FE_BIOAVAIL_FRAC", CS%atm_bc_fe_bioavail_frac, &
111-
"TODO: Add description", units="add_units", default=0.06)
110+
"atmospheric black carbon to iron bioavailablity fraction ratio", units="1", default=0.06)
112111
call get_param(param_file, mdl, "SEAICE_FE_TO_BC_RATIO", CS%seaice_fe_to_bc_ratio, &
113-
"TODO: Add description", units="add_units", default=1.)
112+
"sea-ice iron to black carbon ratio", units="1", default=1.)
114113
call get_param(param_file, mdl, "SEAICE_BC_FE_BIOAVAIL_FRAC", CS%seaice_bc_fe_bioavail_frac, &
115-
"TODO: Add description", units="add_units", default=0.06)
114+
"sea-ice black carbon to iron bioavailablity fraction ratio", units="1", default=0.06)
116115
call get_param(param_file, mdl, "IRON_FRAC_IN_ATM_FINE_DUST", CS%iron_frac_in_atm_fine_dust, &
117-
"Fraction of fine dust from the atmosphere that is iron", units="add_units", default=0.035)
118-
call get_param(param_file, mdl, "IRON_FRAC_IN_ATM_COARSE_DUST", &
119-
CS%iron_frac_in_atm_coarse_dust, &
120-
"Fraction of coarse dust from the atmosphere that is iron", units="add_units", &
121-
default=0.035)
116+
"Fraction of fine dust from the atmosphere that is iron", units="1", default=0.035)
117+
call get_param(param_file, mdl, "IRON_FRAC_IN_ATM_COARSE_DUST", CS%iron_frac_in_atm_coarse_dust, &
118+
"Fraction of coarse dust from the atmosphere that is iron", units="1", default=0.035)
122119
call get_param(param_file, mdl, "IRON_FRAC_IN_SEAICE_DUST", CS%iron_frac_in_seaice_dust, &
123-
"Fraction of dust from sea ice that is iron", units="add_units", default=0.035)
120+
"Fraction of dust from sea ice that is iron", units="1", default=0.035)
124121
call get_param(param_file, mdl, "ATM_CO2_OPT", atm_co2_opt, &
125122
"Source of atmospheric CO2 [constant, diagnostic, or prognostic]", &
126123
default="constant")
@@ -219,17 +216,20 @@ subroutine convert_driver_fields_to_forcings(atm_fine_dust_flux, atm_coarse_dust
219216
!! control structure for MARBL forcing
220217

221218
integer :: i, j, is, ie, js, je, m
222-
real :: atm_fe_bioavail_frac !< TODO: define this (local) term
223-
real :: seaice_fe_bioavail_frac !< TODO: define this (local) term
224-
real :: iron_flux_conversion !< TODO: define this (local) term
225-
real :: ndep_conversion !< Combination of unit conversion factors for rescaling
226-
!! nitrogen deposition [kg(N) m-2 s-1 ~> mol m-3 Z T-1]
219+
real :: atm_fe_bioavail_frac !< Fraction of iron from the atmosphere available for biological uptake [1]
220+
real :: seaice_fe_bioavail_frac !< Fraction of iron from sea ice available for biological uptake [1]
221+
! Note: following two conversion factors are used to both convert from km m-2 s-1 -> mmol m-2 s-1
222+
!! AND cast in MOM6's unique dimensional consistency scaling system [conc Z T-1]
223+
real :: iron_flux_conversion !< Factor to convert iron flux from kg m-2 s-1 -> mmol m-3 (m s-1)
224+
!! [s m2 kg-1 conc Z T-1 ~> mmol kg-1]
225+
real :: ndep_conversion !< Factor to convert nitrogen deposition from kg m-2 s-1 -> mmol m-3 (m s-1)
226+
!! [s m2 kg-1 conc Z T-1 ~> mmol kg-1]
227227

228228
if (.not. CS%use_marbl_tracers) return
229229

230230
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec
231-
ndep_conversion = (1.e6/14.) * (US%m_to_Z * US%T_to_s) ! kg / m^2 / s -> conc Z / T
232-
iron_flux_conversion = (1.e6 / molw_Fe) * (US%m_to_Z * US%T_to_s) ! kg / m^2 / s -> conc Z / T
231+
ndep_conversion = (1.e6/14.) * (US%m_to_Z * US%T_to_s)
232+
iron_flux_conversion = (1.e6 / molw_Fe) * (US%m_to_Z * US%T_to_s)
233233

234234
! Post fields from coupler to diagnostics
235235
! TODO: units from diag register are incorrect; we should be converting these in the cap, I think
@@ -310,8 +310,8 @@ subroutine convert_driver_fields_to_forcings(atm_fine_dust_flux, atm_coarse_dust
310310
! Dust flux
311311
if (associated(atm_fine_dust_flux)) then
312312
do j=js,je ; do i=is,ie
313-
fluxes%dust_flux(i,j) = US%kg_m2s_to_RZ_T * G%mask2dT(i,j) * &
314-
(atm_fine_dust_flux(i-i0,j-j0) + atm_coarse_dust_flux(i-i0,j-j0) + &
313+
fluxes%dust_flux(i,j) = (US%kg_m2s_to_RZ_T * G%mask2dT(i,j)) * &
314+
((atm_fine_dust_flux(i-i0,j-j0) + atm_coarse_dust_flux(i-i0,j-j0)) + &
315315
seaice_dust_flux(i-i0,j-j0))
316316
enddo ; enddo
317317
endif
@@ -346,7 +346,7 @@ subroutine convert_driver_fields_to_forcings(atm_fine_dust_flux, atm_coarse_dust
346346
fluxes%iron_flux(i,j) = fluxes%iron_flux(i,j) + (CS%seaice_bc_fe_bioavail_frac * &
347347
(CS%seaice_fe_to_bc_ratio * seaice_bc_flux(i-i0,j-j0)))
348348

349-
! Unit conversion (kg / m^2 / s -> conc Z/T)
349+
! Unit conversion (kg m-2 s-1 -> conc Z T-1)
350350
fluxes%iron_flux(i,j) = (G%mask2dT(i,j) * iron_flux_conversion) * fluxes%iron_flux(i,j)
351351

352352
enddo ; enddo
@@ -369,7 +369,7 @@ subroutine convert_driver_fields_to_forcings(atm_fine_dust_flux, atm_coarse_dust
369369
fluxes%qsw_cat(i,j,:) = 0.
370370
endwhere
371371
fluxes%fracr_cat(i,j,:) = G%mask2dT(i,j) * fluxes%fracr_cat(i,j,:)
372-
fluxes%qsw_cat(i,j,:) = G%mask2dT(i,j) * fluxes%qsw_cat(i,j,:)
372+
fluxes%qsw_cat(i,j,:) = (US%W_m2_to_QRZ_T * G%mask2dT(i,j)) * fluxes%qsw_cat(i,j,:)
373373
enddo; enddo
374374
endif
375375

src/tracer/MARBL_tracers.F90

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -580,9 +580,11 @@ function register_MARBL_tracers(HI, GV, US, param_file, CS, tr_Reg, restart_CS,
580580
integer :: forcing_file_model_ref_year
581581
integer :: forcing_file_forcing_year
582582
logical :: register_MARBL_tracers
583-
logical :: restoring_has_edges, restoring_use_missing
584-
logical :: restoring_timescale_has_edges, restoring_timescale_use_missing
585-
real :: restoring_missing, restoring_timescale_missing
583+
! read_Z_edges() has several mandatory arguments that we do not use given our expectation
584+
! of how the file being read in was created
585+
logical :: Z_edges_has_edges !< required argument for read_Z_edges()
586+
logical :: Z_edges_use_missing !< required argument for read_Z_edges()
587+
real :: Z_edges_missing !< required argument for read_Z_edges() [CU ~> conc]
586588
integer :: isd, ied, jsd, jed, nz, m, k, kbot
587589
isd = HI%isd ; ied = HI%ied ; jsd = HI%jsd ; jed = HI%jed ; nz = GV%ke
588590

@@ -737,7 +739,7 @@ function register_MARBL_tracers(HI, GV, US, param_file, CS, tr_Reg, restart_CS,
737739

738740
! Set up array for thicknesses in restoring file
739741
call read_Z_edges(CS%restoring_file, "PO4", CS%restoring_z_edges, CS%restoring_nz, &
740-
restoring_has_edges, restoring_use_missing, restoring_missing, scale=US%m_to_Z, &
742+
Z_edges_has_edges, Z_edges_use_missing, Z_edges_missing, scale=US%m_to_Z, &
741743
missing_scale=1.0)
742744
allocate(CS%restoring_dz(CS%restoring_nz))
743745
do k=CS%restoring_nz,1,-1
@@ -756,8 +758,7 @@ function register_MARBL_tracers(HI, GV, US, param_file, CS, tr_Reg, restart_CS,
756758
default="I_TAU")
757759
! Set up array for thicknesses in restoring timescale file
758760
call read_Z_edges(CS%restoring_I_tau_file, CS%restoring_I_tau_var_name, CS%restoring_timescale_z_edges, &
759-
CS%restoring_timescale_nz, restoring_timescale_has_edges, &
760-
restoring_timescale_use_missing, restoring_timescale_missing, scale=US%m_to_Z, &
761+
CS%restoring_timescale_nz, Z_edges_has_edges, Z_edges_use_missing, Z_edges_missing, scale=US%m_to_Z, &
761762
missing_scale=1.0)
762763
allocate(CS%restoring_timescale_dz(CS%restoring_timescale_nz))
763764
do k=CS%restoring_timescale_nz,1,-1
@@ -1044,7 +1045,7 @@ subroutine initialize_MARBL_tracers(restart, day, G, GV, US, h, param_file, diag
10441045
day, trim(longname), trim(units))
10451046
write(name, "(A,I0)") "QSW_CAT_", m
10461047
write(longname, "(A,I0)") "Shortwave penetrating through ice category ", m
1047-
units = "TODO: set units"
1048+
units = "W m-2"
10481049
CS%qsw_cat_id(m) = register_diag_field("ocean_model", trim(name), &
10491050
diag%axesT1, & ! T => tracer grid? 1 => no vertical grid
10501051
day, trim(longname), trim(units))
@@ -1629,7 +1630,7 @@ subroutine MARBL_tracers_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV,
16291630
! second index is num_subcols, not depth
16301631
if (CS%use_ice_category_fields) then
16311632
MARBL_instances%interior_tendency_forcings(CS%surf_shortwave_ind)%field_1d(1,:) = &
1632-
fluxes%qsw_cat(i,j,:)
1633+
fluxes%qsw_cat(i,j,:) * US%QRZ_T_to_W_m2
16331634
else
16341635
MARBL_instances%interior_tendency_forcings(CS%surf_shortwave_ind)%field_1d(1,1) = &
16351636
fluxes%sw(i,j) * US%QRZ_T_to_W_m2

0 commit comments

Comments
 (0)