marbl_tracers module reference¶
A tracer package for tracers computed in the MARBL library.
Data Types¶
Temporary type for diagnostic variables coming from MARBL Allocate exactly one of field_[23]d. |
|
MOM6 needs to know the index of some MARBL tracers to properly apply river fluxes. |
|
MOM needs to store some information about saved_state; besides providing these fields to MARBL, they are also written to restart files. |
|
Pointer to tracer concentration and to tracer_type in tracer registry. |
|
The control structure for the MARBL tracer package. |
Functions/Subroutines¶
This subroutine is used to read marbl_in, configure MARBL accordingly, and then call MARBL’s initialization routine. |
|
This subroutine is used to register tracer fields and subroutines to be used with MOM. |
|
This subroutine initializes the CSntr tracer fields in tr(:,:,:,:) and it sets up the tracer output. |
|
This subroutine is used to register tracer fields and subroutines to be used with MOM. |
|
This subroutine allocates memory for saved state fields and registers them in the restart files. |
|
This subroutine applies diapycnal diffusion and any other column tracer physics or chemistry to the tracers from this file. |
|
This subroutine reads time-varying forcing from files. |
|
This function calculates the mass-weighted integral of all tracer stocks, returning the number of stocks it has calculated. |
|
This subroutine extracts the surface fields from this tracer package that are to be shared with the atmosphere in coupled configurations. |
|
Copy the requested interior tendency output field into an array. |
|
Clean up any allocated memory after the run. |
|
This subroutine writes the contents of the MARBL log using MOM_error(NOTE, …). |
Detailed Description¶
Currently configured for use with marbl0.36.0 https://github.com/marbl-ecosys/MARBL/releases/tag/marbl0.36.0 (clone entire repo into pkg/MARBL)
Type Documentation¶
-
type
marbl_tracers/temp_marbl_diag¶ Temporary type for diagnostic variables coming from MARBL Allocate exactly one of field_[23]d.
- Type fields:
%id[integer,private] :: index into MOM diagnostic structure%field_2d[real(:,:),allocatable, private] :: memory for 2D field%field_3d[real(:,:,:),allocatable, private] :: memory for 3D field
-
type
marbl_tracers/tracer_ind_type¶ MOM6 needs to know the index of some MARBL tracers to properly apply river fluxes.
- Type fields:
%no3_ind[integer,private] :: NO3 index.%po4_ind[integer,private] :: PO4 index.%don_ind[integer,private] :: DON index.%donr_ind[integer,private] :: DONr index.%dop_ind[integer,private] :: DOP index.%dopr_ind[integer,private] :: DOPr index.%sio3_ind[integer,private] :: SiO3 index.%fe_ind[integer,private] :: Fe index.%doc_ind[integer,private] :: DOC index.%docr_ind[integer,private] :: DOCr index.%alk_ind[integer,private] :: ALK index.%alk_alt_co2_ind[integer,private] :: ALK_ALT_CO2 index.%dic_ind[integer,private] :: DIC index.%dic_alt_co2_ind[integer,private] :: DIC_ALT_CO2 index.%abio_dic_ind[integer,private] :: ABIO_DIC index.%abio_di14c_ind[integer,private] :: ABIO_DI14C index.
-
type
marbl_tracers/saved_state_for_marbl_type¶ MOM needs to store some information about saved_state; besides providing these fields to MARBL, they are also written to restart files.
- Type fields:
%short_name[character (len=200),private] :: name of variable being saved%file_varname[character (len=200),private] :: name of variable in restart file%units[character (len=200),private] :: variable units%field_2d[real(:,:),pointer, private] :: memory for 2D field%field_3d[real(:,:,:),pointer, private] :: memory for 3D field
-
type
marbl_tracers/marbl_tracer_data¶ Pointer to tracer concentration and to tracer_type in tracer registry.
- Type fields:
%tr[real(:,:,:),pointer, private] :: Array of tracers used in this subroutine [CU ~> conc] (ALK tracers use meq m-3 instead of mmol m-3)%tr_ptr[type( tracer_type ),pointer, private] :: pointer to tracer inside Tr_reg
-
type
marbl_tracers/marbl_tracers_cs¶ The control structure for the MARBL tracer package.
- Type fields:
%ntr[integer] :: The number of tracers that are actually used.%debug[logical] :: If true, write verbose checksums for debugging purposes.%base_bio_on[logical] :: Will MARBL use base biotic tracers?%abio_dic_on[logical] :: Will MARBL use abiotic DIC / DI14C tracers?%ciso_on[logical] :: Will MARBL use isotopic tracers?%restore_count[integer] :: The number of tracers MARBL is configured to restore.%coupled_tracers[logical] :: These tracers are not offered to the coupler.%use_ice_category_fields[logical] :: Forcing will include multiple ice categories for ice_frac and shortwave.%request_chl_from_marbl[logical] :: MARBL can provide Chl to use in%ice_ncat[integer] :: Number of ice categories when use_ice_category_fields = True.%ic_min[real] :: Minimum value for tracer initial conditions [CU ~> conc].%ic_file[character (len=200)] :: The file in which the age-tracer initial values cam be found.%ongrid[logical] :: True if IC_file is already interpolated to MOM grid.%tr_reg[type( tracer_registry_type ),pointer] :: A pointer to the tracer registry.%tracer_data[type( marbl_tracer_data )(:),allocatable] :: type containing tracer data and pointer into tracer registry%ind_tr[integer(:),allocatable] :: Indices returned by aof_set_coupler_flux if it is used and the surface tracer concentrations are to be provided to the coupler.%diag[type( diag_ctrl ),pointer] :: A structure that is used to regulate the timing of diagnostic output.%restart_csp[type( mom_restart_cs ),pointer] :: A pointer to the restart control structure.%tr_desc[type( vardesc )(:),allocatable] :: Descriptions and metadata for the tracers.%tracers_may_reinit[logical] :: If true the tracers may be initialized if not found in a restart file.%fesedflux_file[character (len=200)] :: name of [netCDF] file containing iron sediment flux%feventflux_file[character (len=200)] :: name of [netCDF] file containing iron vent flux%d14c_dataset[type( forcing_timeseries_dataset )(3)] :: File and time axis information for d14c forcing.%d14c_bands[real(3)] :: forcing is organized into bands: [30 N, 90 N]; [30 S, 30 N]; [90 S, 30 S] This variable contains D14C for each band [CU ~> conc]%d14c_id[integer] :: id for diagnostic field with d14c forcing%read_riv_fluxes[logical] :: If true, use river fluxes supplied from an input file. This is temporary, we will always read river fluxes.%riv_flux_dataset[type( forcing_timeseries_dataset )] :: File and time axis information for river fluxes.%restoring_source[character (len=4)] :: location of tracer restoring data valid values: file, none%restoring_nz[integer] :: number of levels in tracer restoring file%restoring_z_edges[real(:),allocatable] :: The depths of the cell interfaces in the tracer restoring file [Z ~> m].%restoring_dz[real(:),allocatable] :: The thickness of the cell layers in the tracer restoring file [H ~> m].%restoring_timescale_nz[integer] :: number of levels in tracer restoring timescale file%restoring_timescale_z_edges[real(:),allocatable] :: The depths of the cell interfaces in the tracer restoring timescale file [Z ~> m].%restoring_timescale_dz[real(:),allocatable] :: The thickness of the cell layers in the tracer restoring timescale file [H ~> m].%restoring_i_tau_source[character (len=14)] :: location of inverse restoring timescale data valid values: file, grid_dependent%restoring_file[character (len=200)] :: name of [netCDF] file containing tracer restoring data%restoring_remapcs[type( remapping_cs )] :: Remapping parameters and work arrays for tracer restoring / timescale.%restoring_i_tau_file[character (len=200)] :: name of [netCDF] file containing inverse restoring timescale%restoring_i_tau_var_name[character (len=200)] :: name of field containing inverse restoring timescale%marbl_settings_file[character (len=35)] :: name of [text] file containing MARBL settings%bot_flux_mix_thickness[real] :: for bottom flux -> tendency conversion, assume uniform mixing over bottom layer of prescribed thickness [Z ~> m]%ibfmt[real] :: Reciprocal of bot_flux_mix_thickness [Z-1 ~> m-1].%surface_flux_diags[type( temp_marbl_diag )(:),allocatable] :: collect surface flux diagnostics from all columns before posting%interior_tendency_diags[type( temp_marbl_diag )(:),allocatable] :: collect tendency diagnostics from all columns before posting%surface_flux_saved_state[type( saved_state_for_marbl_type )(:),allocatable] :: surface_flux saved state%interior_tendency_saved_state[type( saved_state_for_marbl_type )(:),allocatable] :: interior_tendency saved state%tracer_inds[type( tracer_ind_type )] :: Indices to tracers that will have river fluxes added to STF.%id_surface_flux_out[integer(:),allocatable] :: Need to store global output from both marbl_instancesurface_flux_compute() and marbl_instanceinterior_tendency_compute(). For the former, just need id to register because we already copy data into CSSTF; latter requires copying data and indices so currently using temp_MARBL_diag for that.%id_surface_flux_from_salt_flux[integer(:),allocatable] :: register_diag indices for surface_flux from salt_flux%interior_tendency_out[type( temp_marbl_diag )(:),allocatable] :: collect interior tendencies for diagnostic output%interior_tendency_out_zint[type( temp_marbl_diag )(:),allocatable] :: vertical integral of interior tendencies (full column)%interior_tendency_out_zint_100m[type( temp_marbl_diag )(:),allocatable] :: vertical integral of interior tendencies (top 100m)%bot_flux_to_tend_id[integer] :: register_diag index for BOT_FLUX_TO_TEND%fracr_cat_id[integer(:),allocatable] :: register_diag index for per-category ice fraction%qsw_cat_id[integer(:),allocatable] :: register_diag index for per-category shortwave%dic_salt_ratio[real] :: ratio to convert salt surface flux to DIC surface flux [conc ppt-1]%alk_salt_ratio[real] :: ratio to convert salt surface flux to ALK surface flux [conc ppt-1]%stf[real(:,:,:),allocatable] :: surface fluxes returned from MARBL to use in tracer_vertdiff (dims: i, j, tracer) [conc Z T-1 ~> conc m s-1]%sfo[real(:,:,:),pointer] :: surface flux output returned from MARBL for use in GCM e.g. CO2 flux to pass to atmosphere (dims: i, j, num_sfo) Units vary based on index of num_sfo dimension%ito[real(:,:,:,:),pointer] :: interior tendency output returned from MARBL for use in GCM e.g. total chlorophyll to use in shortwave penetration (dims: i, j, k, num_ito) Units vary based on index of num_ito dimension%u10_sqr_ind[integer] :: index of MARBL forcing field array to copy 10-m wind (squared) into%sss_ind[integer] :: index of MARBL forcing field array to copy sea surface salinity into%sst_ind[integer] :: index of MARBL forcing field array to copy sea surface temperature into%ifrac_ind[integer] :: index of MARBL forcing field array to copy ice fraction into%dust_dep_ind[integer] :: index of MARBL forcing field array to copy dust flux into%fe_dep_ind[integer] :: index of MARBL forcing field array to copy iron flux into%nox_flux_ind[integer] :: index of MARBL forcing field array to copy NOx flux into%nhy_flux_ind[integer] :: index of MARBL forcing field array to copy NHy flux into%atmpress_ind[integer] :: index of MARBL forcing field array to copy atmospheric pressure into%xco2_ind[integer] :: index of MARBL forcing field array to copy CO2 flux into%xco2_alt_ind[integer] :: index of MARBL forcing field array to copy CO2 flux (alternate CO2) into%d14c_ind[integer] :: index of MARBL forcing field array to copy d14C into%id_din_riv[type(external_field)] :: external_field types for river fluxes (added to surface fluxes)%id_don_riv[type(external_field)] :: id for time_interp_external.%id_dip_riv[type(external_field)] :: id for time_interp_external.%id_dop_riv[type(external_field)] :: id for time_interp_external.%id_dsi_riv[type(external_field)] :: id for time_interp_external.%id_dfe_riv[type(external_field)] :: id for time_interp_external.%id_dic_riv[type(external_field)] :: id for time_interp_external.%id_alk_riv[type(external_field)] :: id for time_interp_external.%id_doc_riv[type(external_field)] :: id for time_interp_external.%id_d14c[type(external_field)(3)] :: external_field type for d14c (needed if abio_dic_on is True)%no3_riv_flux[integer] :: Indices for river fluxes (diagnostics)%po4_riv_flux[integer] :: PO4 riverine flux.%don_riv_flux[integer] :: DON riverine flux.%donr_riv_flux[integer] :: DONr riverine flux.%dop_riv_flux[integer] :: DOP riverine flux.%dopr_riv_flux[integer] :: DOPr riverine flux.%sio3_riv_flux[integer] :: SiO3 riverine flux.%fe_riv_flux[integer] :: Fe riverine flux.%doc_riv_flux[integer] :: DOC riverine flux.%docr_riv_flux[integer] :: DOCr riverine flux.%alk_riv_flux[integer] :: ALK riverine flux.%alk_alt_co2_riv_flux[integer] :: ALK (alternate CO2) riverine flux.%dic_riv_flux[integer] :: DIC riverine flux.%dic_alt_co2_riv_flux[integer] :: DIC (alternate CO2) riverine flux.%dustflux_ind[integer] :: Indices for forcing fields required to compute interior tendencies.%par_col_frac_ind[integer] :: index of MARBL forcing field array to copy PAR column fraction into%surf_shortwave_ind[integer] :: index of MARBL forcing field array to copy surface shortwave into%potemp_ind[integer] :: index of MARBL forcing field array to copy potential temperature into%salinity_ind[integer] :: index of MARBL forcing field array to copy salinity into%pressure_ind[integer] :: index of MARBL forcing field array to copy pressure into%fesedflux_ind[integer] :: index of MARBL forcing field array to copy iron sediment flux into%o2_scalef_ind[integer] :: index of MARBL forcing field array to copy O2 scale length into%remin_scalef_ind[integer] :: index of MARBL forcing field array to copy remin scale length into%id_tracer_restoring[type(external_field)(:),allocatable] :: id number for time_interp_external%tracer_restoring_ind[integer(:),allocatable] :: index of MARBL forcing field to copy per-tracer restoring field into%tracer_i_tau_ind[integer(:),allocatable] :: index of MARBL forcing field to copy per-tracer inverse restoring timescale into%d14c[real(:,:),allocatable] :: Memory for storing river fluxes, tracer restoring fields, and abiotic forcing.%riv_fluxes[real(:,:,:),allocatable] :: river flux forcing for applyTracerBoundaryFluxesInOut (needs to be time-integrated when passed to function!) (dims: i, j, tracer) [conc m s-1]%tracer_restoring_varname[character (len=15)(:),allocatable] :: name of variable being restored%i_tau[real(:,:,:),allocatable] :: inverse restoring timescale for marbl tracers (dims: i, j, k) [s-1]%restoring_in[real(:,:,:,:),allocatable] :: Restoring fields read from file (dims: i, j, restoring_nz, restoring_cnt) [tracer units].%sfo_cnt[integer] :: Number of surface flux outputs as well as specific indices for each one.%ito_cnt[integer] :: number of interior tendency outputs from MARBL%flux_co2_ind[integer] :: index to co2 flux surface flux output%total_chl_ind[integer] :: index to total chlorophyll interior tendency output%fesedflux_scale_factor[real] :: scale factor for iron sediment flux [mmol umol-1 d s-1]%fesedflux_nz[integer] :: number of levels in iron sediment flux file%fesedflux_in[real(:,:,:),allocatable] :: Field to read iron sediment flux into [conc m s-1].%feventflux_in[real(:,:,:),allocatable] :: Field to read iron vent flux into [conc m s-1].%fesedflux_z_edges[real(:),allocatable] :: The depths of the cell interfaces in the input data [Z ~> m].%fesedflux_dz[real(:,:,:),allocatable] :: The thickness of the cell layers in the input data [H ~> m].
Function/Subroutine Documentation¶
-
subroutine
marbl_tracers/configure_marbl_tracers(GV, US, param_file, CS)¶ This subroutine is used to read marbl_in, configure MARBL accordingly, and then call MARBL’s initialization routine.
- Parameters:
gv :: [in] The ocean’s vertical grid structure
us :: [in] A dimensional unit scaling type
param_file :: [in] A structure to parse for run-time parameters
cs :: A pointer that is set to point to the control structure for this module
- Call to:
marbl_instancesmom_error_handler::mom_errorprint_marbl_log- Called from:
-
function
marbl_tracers/register_marbl_tracers(HI, GV, US, param_file, CS, tr_Reg, restart_CS, MARBL_computes_chl) [logical]¶ This subroutine is used to register tracer fields and subroutines to be used with MOM.
- Parameters:
hi :: [in] A horizontal index type structure.
gv :: [in] The ocean’s vertical grid structure
us :: [in] A dimensional unit scaling type
param_file :: [in] A structure to parse for run-time parameters
cs :: A pointer that is set to point to the control structure for this module
tr_reg :: A pointer that is set to point to the control structure for the tracer advection and diffusion module.
restart_cs :: [inout] MOM restart control struct
marbl_computes_chl :: [out] If MARBL is computing chlorophyll, MOM may use it to compute SW penetration
- Call to:
atmos_ocean_fluxes_mod::aof_set_coupler_fluxconfigure_marbl_tracersmom_remapping::initialize_remappingmarbl_instancesmom_error_handler::mom_errormom_io::query_vardescmom_tracer_z_init::read_z_edgesmom_tracer_registry::register_tracerset_riv_flux_tracer_indssetup_saved_statemom_io::var_desc
-
subroutine
marbl_tracers/initialize_marbl_tracers(restart, day, G, GV, US, h, param_file, diag, OBC, CS, sponge_CSp)¶ This subroutine initializes the CSntr tracer fields in tr(:,:,:,:) and it sets up the tracer output.
- Parameters:
restart :: [in] .true. if the fields have already been read from a restart file.
day :: [in] Time of the start of the run.
g :: [inout] The ocean’s grid structure
gv :: [in] The ocean’s vertical grid structure
us :: [in] A dimensional unit scaling type
h :: [in] Layer thicknesses [H ~> m or kg m-2]
param_file :: [in] A structure to parse for run-time parameters
diag :: [in] Structure used to regulate diagnostic output.
obc :: This open boundary condition type specifies whether, where, and what open boundary conditions are used.
cs :: The control structure returned by a previous call to register_MARBL_tracers.
sponge_csp :: A pointer to the control structure for the sponges, if they are in use.
- Call to:
marbl_instancesmom_error_handler::mom_errormom_tracer_initialization_from_z::mom_initialize_tracer_from_zmom_io::query_vardescmom_tracer_z_init::read_z_edgesmom_diag_mediator::register_diag_fieldregister_marbl_diags
-
subroutine
marbl_tracers/register_marbl_diags(MARBL_diags, diag, day, G, id_diags)¶ This subroutine is used to register tracer fields and subroutines to be used with MOM.
- Parameters:
marbl_diags :: [in] MARBL diagnostics from MARBL_instances
day :: [in] Time of the start of the run.
diag :: [in] Structure used to regulate diagnostic output.
g :: [in] The ocean’s grid structure
id_diags :: [inout] allocatable array storing diagnostic index number and buffer space for collecting diags from all columns
- Call to:
- Called from:
-
subroutine
marbl_tracers/setup_saved_state(MARBL_saved_state, HI, GV, restart_CS, tracers_may_reinit, local_saved_state)¶ This subroutine allocates memory for saved state fields and registers them in the restart files.
- Parameters:
marbl_saved_state :: [in] MARBL saved state from MARBL_instances
hi :: [in] A horizontal index type structure.
gv :: [in] The ocean’s vertical grid structure
restart_cs :: [in] control structure to add saved state to restarts
tracers_may_reinit :: [in] used to determine mandatory flag in restart
local_saved_state :: [inout] allocatable array for local saved state
- Call to:
- Called from:
-
subroutine
marbl_tracers/marbl_tracers_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, US, CS, tv, KPP_CSp, nonLocalTrans, evap_CFL_limit, minimum_forcing_depth)¶ This subroutine applies diapycnal diffusion and any other column tracer physics or chemistry to the tracers from this file.
- Parameters:
g :: [in] The ocean’s grid structure
gv :: [in] The ocean’s vertical grid structure
h_old :: [in] Layer thickness before entrainment [H ~> m or kg m-2].
h_new :: [in] Layer thickness after entrainment [H ~> m or kg m-2].
ea :: [in] an array to which the amount of fluid entrained
eb :: [in] an array to which the amount of fluid entrained
fluxes :: [in] A structure containing pointers to thermodynamic and tracer forcing fields. Unused fields have NULL ptrs.
dt :: [in] The amount of time covered by this call [T ~> s]
us :: [in] A dimensional unit scaling type
cs :: The control structure returned by a previous call to register_MARBL_tracers.
tv :: [in] A structure pointing to various thermodynamic variables
kpp_csp :: KPP control structure
nonlocaltrans :: [in] Non-local transport [1]
evap_cfl_limit :: [in] Limit on the fraction of the water that can be fluxed out of the top layer in a timestep [1]
minimum_forcing_depth :: [in] The smallest depth over which fluxes can be applied [m]
- Call to:
mom_tracer_diabatic::applytracerboundaryfluxesinoutatm_per_pamom_cvmix_kpp::kpp_nonlocaltransportmarbl_instancesmom_error_handler::mom_errorprint_marbl_logmom_remapping::remapping_core_hmom_tracer_diabatic::tracer_vertdiff
-
subroutine
marbl_tracers/marbl_tracers_set_forcing(day_start, G, CS)¶ This subroutine reads time-varying forcing from files.
- Parameters:
day_start :: [in] Start time of the fluxes.
g :: [in] The ocean’s grid structure.
cs :: The control structure returned by a
- Call to:
-
function
marbl_tracers/marbl_tracers_stock(h, stocks, G, GV, CS, names, units, stock_index) [integer]¶ This function calculates the mass-weighted integral of all tracer stocks, returning the number of stocks it has calculated. If the stock_index is present, only the stock corresponding to that coded index is returned.
- Parameters:
h :: [in] Layer thicknesses [H ~> m or kg m-2]
stocks :: [out] the mass-weighted integrated amount of each tracer, in kg times concentration units [kg conc].
g :: [in] The ocean’s grid structure
gv :: [in] The ocean’s vertical grid structure
cs :: The control structure returned by a previous call to register_MARBL_tracers.
names :: [out] the names of the stocks calculated.
units :: [out] the units of the stocks calculated.
stock_index :: [in] the coded index of a specific stock being sought.
- Return:
undefined :: Return value: the number of stocks calculated here.
- Call to:
mom_spatial_means::global_mass_int_efpmom_io::query_vardesc- Called from:
-
subroutine
marbl_tracers/marbl_tracers_surface_state(sfc_state, G, US, CS)¶ This subroutine extracts the surface fields from this tracer package that are to be shared with the atmosphere in coupled configurations.
- Parameters:
g :: [in] The ocean’s grid structure.
sfc_state :: [inout] A structure containing fields that describe the surface state of the ocean.
us :: [in] A dimensional unit scaling type
cs :: The control structure returned by a previous call to register_MARBL_tracers.
-
subroutine
marbl_tracers/marbl_tracers_get(name, G, GV, array, CS)¶ Copy the requested interior tendency output field into an array.
- Parameters:
name :: [in] Name of requested tracer.
g :: [in] The ocean’s grid structure.
gv :: [in] The ocean’s vertical grid structure.
array :: [inout] Array filled by this routine.
cs :: Pointer to the control structure for this module.
- Call to:
-
subroutine
marbl_tracers/marbl_tracers_end(CS)¶ Clean up any allocated memory after the run.
- Parameters:
cs :: [inout] The control structure returned by a previous call to register_MARBL_tracers.
- Call to:
marbl_instancesprint_marbl_log- Called from:
-
subroutine
marbl_tracers/set_riv_flux_tracer_inds(CS)¶ - Parameters:
cs :: [inout] The MARBL tracers control structure
- Call to:
marbl_instancesmom_error_handler::mom_error- Called from:
-
subroutine
marbl_tracers/print_marbl_log(log_to_print, G, i, j)¶ This subroutine writes the contents of the MARBL log using MOM_error(NOTE, …).
- Parameters:
log_to_print :: [in] MARBL log to include in MOM6 logfile
g :: [in] The ocean’s grid structure
i :: [in] i of (i,j) index of column providing the log
j :: [in] j of (i,j) index of column providing the log
- Call to:
- Called from:
configure_marbl_tracersmarbl_tracers_column_physicsmarbl_tracers_end