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, privateindex into MOM diagnostic structure% field_2d ::
real, dimension(:,:), allocatable, privatememory for 2D field% field_3d ::
real, dimension(:,:,:), allocatable, privatememory 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, privateNO3 index.% po4_ind ::
integer, privatePO4 index.% don_ind ::
integer, privateDON index.% donr_ind ::
integer, privateDONr index.% dop_ind ::
integer, privateDOP index.% dopr_ind ::
integer, privateDOPr index.% sio3_ind ::
integer, privateSiO3 index.% fe_ind ::
integer, privateFe index.% doc_ind ::
integer, privateDOC index.% docr_ind ::
integer, privateDOCr index.% alk_ind ::
integer, privateALK index.% alk_alt_co2_ind ::
integer, privateALK_ALT_CO2 index.% dic_ind ::
integer, privateDIC index.% dic_alt_co2_ind ::
integer, privateDIC_ALT_CO2 index.% abio_dic_ind ::
integer, privateABIO_DIC index.% abio_di14c_ind ::
integer, privateABIO_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), privatename of variable being saved% file_varname ::
character(len=200), privatename of variable in restart file% units ::
character(len=200), privatevariable units% field_2d ::
real, dimension(:,:), pointer, privatememory for 2D field% field_3d ::
real, dimension(:,:,:), pointer, privatememory for 3D field
- type marbl_tracers/marbl_tracer_data
Pointer to tracer concentration and to tracer_type in tracer registry.
- Type fields:
% tr ::
real, dimension(:,:,:), pointer, privateArray 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, privatepointer to tracer inside Tr_reg
- type marbl_tracers/marbl_tracers_cs
The control structure for the MARBL tracer package.
- Type fields:
% ntr ::
integerThe number of tracers that are actually used.% debug ::
logicalIf true, write verbose checksums for debugging purposes.% base_bio_on ::
logicalWill MARBL use base biotic tracers?% abio_dic_on ::
logicalWill MARBL use abiotic DIC / DI14C tracers?% ciso_on ::
logicalWill MARBL use isotopic tracers?% restore_count ::
integerThe number of tracers MARBL is configured to restore.% coupled_tracers ::
logicalThese tracers are not offered to the coupler.% use_ice_category_fields ::
logicalForcing will include multiple ice categories for ice_frac and shortwave.% request_chl_from_marbl ::
logicalMARBL can provide Chl to use in% ice_ncat ::
integerNumber of ice categories when use_ice_category_fields = True.% ic_min ::
realMinimum 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 ::
logicalTrue if IC_file is already interpolated to MOM grid.% tr_reg ::
type(tracer_registry_type), pointerA pointer to the tracer registry.% tracer_data ::
type(marbl_tracer_data), dimension(:), allocatabletype containing tracer data and pointer into tracer registry% ind_tr ::
integer, dimension(:), allocatableIndices 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), pointerA structure that is used to regulate the timing of diagnostic output.% restart_csp ::
type(mom_restart_cs), pointerA pointer to the restart control structure.% tr_desc ::
type(vardesc), dimension(:), allocatableDescriptions and metadata for the tracers.% tracers_may_reinit ::
logicalIf 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), dimension(3)File and time axis information for d14c forcing.% d14c_bands ::
real, dimension(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 ::
integerid for diagnostic field with d14c forcing% read_riv_fluxes ::
logicalIf 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 ::
integernumber of levels in tracer restoring file% restoring_z_edges ::
real, dimension(:), allocatableThe depths of the cell interfaces in the tracer restoring file [Z ~> m].% restoring_dz ::
real, dimension(:), allocatableThe thickness of the cell layers in the tracer restoring file [H ~> m].% restoring_timescale_nz ::
integernumber of levels in tracer restoring timescale file% restoring_timescale_z_edges ::
real, dimension(:), allocatableThe depths of the cell interfaces in the tracer restoring timescale file [Z ~> m].% restoring_timescale_dz ::
real, dimension(:), allocatableThe 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 ::
realfor bottom flux -> tendency conversion, assume uniform mixing over bottom layer of prescribed thickness [Z ~> m]% ibfmt ::
realReciprocal of bot_flux_mix_thickness [Z-1 ~> m-1].% surface_flux_diags ::
type(temp_marbl_diag), dimension(:), allocatablecollect surface flux diagnostics from all columns before posting% interior_tendency_diags ::
type(temp_marbl_diag), dimension(:), allocatablecollect tendency diagnostics from all columns before posting% surface_flux_saved_state ::
type(saved_state_for_marbl_type), dimension(:), allocatablesurface_flux saved state% interior_tendency_saved_state ::
type(saved_state_for_marbl_type), dimension(:), allocatableinterior_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, dimension(:), allocatableNeed 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, dimension(:), allocatableregister_diag indices for surface_flux from salt_flux% interior_tendency_out ::
type(temp_marbl_diag), dimension(:), allocatablecollect interior tendencies for diagnostic output% interior_tendency_out_zint ::
type(temp_marbl_diag), dimension(:), allocatablevertical integral of interior tendencies (full column)% interior_tendency_out_zint_100m ::
type(temp_marbl_diag), dimension(:), allocatablevertical integral of interior tendencies (top 100m)% bot_flux_to_tend_id ::
integerregister_diag index for BOT_FLUX_TO_TEND% fracr_cat_id ::
integer, dimension(:), allocatableregister_diag index for per-category ice fraction% qsw_cat_id ::
integer, dimension(:), allocatableregister_diag index for per-category shortwave% dic_salt_ratio ::
realratio to convert salt surface flux to DIC surface flux [conc ppt-1]% alk_salt_ratio ::
realratio to convert salt surface flux to ALK surface flux [conc ppt-1]% stf ::
real, dimension(:,:,:), allocatablesurface fluxes returned from MARBL to use in tracer_vertdiff (dims: i, j, tracer) [conc Z T-1 ~> conc m s-1]% sfo ::
real, dimension(:,:,:), pointersurface 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, dimension(:,:,:,:), pointerinterior 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 ::
integerindex of MARBL forcing field array to copy 10-m wind (squared) into% sss_ind ::
integerindex of MARBL forcing field array to copy sea surface salinity into% sst_ind ::
integerindex of MARBL forcing field array to copy sea surface temperature into% ifrac_ind ::
integerindex of MARBL forcing field array to copy ice fraction into% dust_dep_ind ::
integerindex of MARBL forcing field array to copy dust flux into% fe_dep_ind ::
integerindex of MARBL forcing field array to copy iron flux into% nox_flux_ind ::
integerindex of MARBL forcing field array to copy NOx flux into% nhy_flux_ind ::
integerindex of MARBL forcing field array to copy NHy flux into% atmpress_ind ::
integerindex of MARBL forcing field array to copy atmospheric pressure into% xco2_ind ::
integerindex of MARBL forcing field array to copy CO2 flux into% xco2_alt_ind ::
integerindex of MARBL forcing field array to copy CO2 flux (alternate CO2) into% d14c_ind ::
integerindex 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), dimension(3)external_field type for d14c (needed if abio_dic_on is True)% no3_riv_flux ::
integerIndices for river fluxes (diagnostics)% po4_riv_flux ::
integerPO4 riverine flux.% don_riv_flux ::
integerDON riverine flux.% donr_riv_flux ::
integerDONr riverine flux.% dop_riv_flux ::
integerDOP riverine flux.% dopr_riv_flux ::
integerDOPr riverine flux.% sio3_riv_flux ::
integerSiO3 riverine flux.% fe_riv_flux ::
integerFe riverine flux.% doc_riv_flux ::
integerDOC riverine flux.% docr_riv_flux ::
integerDOCr riverine flux.% alk_riv_flux ::
integerALK riverine flux.% alk_alt_co2_riv_flux ::
integerALK (alternate CO2) riverine flux.% dic_riv_flux ::
integerDIC riverine flux.% dic_alt_co2_riv_flux ::
integerDIC (alternate CO2) riverine flux.% dustflux_ind ::
integerIndices for forcing fields required to compute interior tendencies.% par_col_frac_ind ::
integerindex of MARBL forcing field array to copy PAR column fraction into% surf_shortwave_ind ::
integerindex of MARBL forcing field array to copy surface shortwave into% potemp_ind ::
integerindex of MARBL forcing field array to copy potential temperature into% salinity_ind ::
integerindex of MARBL forcing field array to copy salinity into% pressure_ind ::
integerindex of MARBL forcing field array to copy pressure into% fesedflux_ind ::
integerindex of MARBL forcing field array to copy iron sediment flux into% o2_scalef_ind ::
integerindex of MARBL forcing field array to copy O2 scale length into% remin_scalef_ind ::
integerindex of MARBL forcing field array to copy remin scale length into% id_tracer_restoring ::
type(external_field), dimension(:), allocatableid number for time_interp_external% tracer_restoring_ind ::
integer, dimension(:), allocatableindex of MARBL forcing field to copy per-tracer restoring field into% tracer_i_tau_ind ::
integer, dimension(:), allocatableindex of MARBL forcing field to copy per-tracer inverse restoring timescale into% d14c ::
real, dimension(:,:), allocatableMemory for storing river fluxes, tracer restoring fields, and abiotic forcing.% riv_fluxes ::
real, dimension(:,:,:), allocatableriver 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), dimension(:), allocatablename of variable being restored% i_tau ::
real, dimension(:,:,:), allocatableinverse restoring timescale for marbl tracers (dims: i, j, k) [s-1]% restoring_in ::
real, dimension(:,:,:,:), allocatableRestoring fields read from file (dims: i, j, restoring_nz, restoring_cnt) [tracer units].% sfo_cnt ::
integerNumber of surface flux outputs as well as specific indices for each one.% ito_cnt ::
integernumber of interior tendency outputs from MARBL% flux_co2_ind ::
integerindex to co2 flux surface flux output% total_chl_ind ::
integerindex to total chlorophyll interior tendency output% fesedflux_scale_factor ::
realscale factor for iron sediment flux [mmol umol-1 d s-1]% fesedflux_nz ::
integernumber of levels in iron sediment flux file% fesedflux_in ::
real, dimension(:,:,:), allocatableField to read iron sediment flux into [conc m s-1].% feventflux_in ::
real, dimension(:,:,:), allocatableField to read iron vent flux into [conc m s-1].% fesedflux_z_edges ::
real, dimension(:), allocatableThe depths of the cell interfaces in the input data [Z ~> m].% fesedflux_dz ::
real, dimension(:,:,:), allocatableThe 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 ::
param_file[in] A structure to parse for run-time parameterscs :: 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)
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 ::
param_file[in] A structure to parse for run-time parameterscs :: 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 ::
restart[in] .true. if the fields have already been read from a restart file.day ::
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 ::
h[in] Layer thicknesses [H ~> m or kg m-2]param_file ::
param_file[in] A structure to parse for run-time parametersdiag ::
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 ::
day[in] Time of the start of the run.diag ::
diag[in] Structure used to regulate diagnostic output.g :: [in] The ocean’s grid structure
id_diags ::
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 ::
tracers_may_reinit[in] used to determine mandatory flag in restartlocal_saved_state ::
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 ::
h_old[in] Layer thickness before entrainment [H ~> m or kg m-2].h_new ::
h_new[in] Layer thickness after entrainment [H ~> m or kg m-2].ea ::
ea[in] an array to which the amount of fluid entrainedeb ::
eb[in] an array to which the amount of fluid entrainedfluxes ::
fluxes[in] A structure containing pointers to thermodynamic and tracer forcing fields. Unused fields have NULL ptrs.dt ::
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 ::
tv[in] A structure pointing to various thermodynamic variableskpp_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 ::
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 ::
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)
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 ::
h[in] Layer thicknesses [H ~> m or kg m-2]stocks ::
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 ::
names[out] the names of the stocks calculated.units ::
units[out] the units of the stocks calculated.stock_index ::
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 ::
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 ::
name[in] Name of requested tracer.g :: [in] The ocean’s grid structure.
gv :: [in] The ocean’s vertical grid structure.
array ::
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 ::
log_to_print[in] MARBL log to include in MOM6 logfileg :: [in] The ocean’s grid structure
i ::
i[in] i of (i,j) index of column providing the logj ::
j[in] j of (i,j) index of column providing the log
- Call to:
- Called from:
configure_marbl_tracersmarbl_tracers_column_physicsmarbl_tracers_end