MARBL_tracers module reference
A tracer package for tracers computed in the MARBL library
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)
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 CS%ntr 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. If the stock_index is present, only the stock corresponding to that coded index is returned. |
|
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
This module contains the code that is needed to provide the MARBL BGC tracer library with necessary forcings and apply the resulting surface fluxes and tendencies to the requested tracers.
Type Documentation
- type :: temp_MARBL_diag
Temporary type for diagnostic variables coming from MARBL Allocate exactly one of field_[23]d
- Parameters
id
index into MOM diagnostic structure
field_2d
memory for 2D field
field_3d
memory for 3D field
- type :: tracer_ind_type
MOM6 needs to know the index of some MARBL tracers to properly apply river fluxes
- Parameters
no3_ind
NO3 index
po4_ind
PO4 index
don_ind
DON index
donr_ind
DONr index
dop_ind
DOP index
dopr_ind
DOPr index
sio3_ind
SiO3 index
fe_ind
Fe index
doc_ind
DOC index
docr_ind
DOCr index
alk_ind
ALK index
alk_alt_co2_ind
ALK_ALT_CO2 index
dic_ind
DIC index
dic_alt_co2_ind
DIC_ALT_CO2 index
abio_dic_ind
ABIO_DIC index
abio_di14c_ind
ABIO_DI14C index
- type :: 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
- Parameters
short_name
name of variable being saved
file_varname
name of variable in restart file
units
variable units
field_2d
memory for 2D field
field_3d
memory for 3D field
- type, private :: MARBL_tracer_data
Pointer to tracer concentration and to tracer_type in tracer registry
- Parameters
tr
Array of tracers used in this subroutine [CU ~> conc] (ALK tracers use meq m-3 instead of mmol m-3)
tr_ptr
pointer to tracer inside Tr_reg
- type, public :: MARBL_tracers_CS
The control structure for the MARBL tracer package
- Parameters
ntr
The number of tracers that are actually used.
debug
If true, write verbose checksums for debugging purposes.
base_bio_on
Will MARBL use base biotic tracers?
abio_dic_on
Will MARBL use abiotic DIC / DI14C tracers?
ciso_on
Will MARBL use isotopic tracers?
restore_count
The number of tracers MARBL is configured to restore
coupled_tracers
These tracers are not offered to the coupler.
use_ice_category_fields
Forcing will include multiple ice categories for ice_frac and shortwave
request_Chl_from_MARBL
MARBL can provide Chl to use in set_pen_shortwave()
ice_ncat
Number of ice categories when use_ice_category_fields = True
IC_min
Minimum value for tracer initial conditions [CU ~> conc]
IC_file
The file in which the age-tracer initial values cam be found.
ongrid
True if IC_file is already interpolated to MOM grid
tr_Reg
A pointer to the tracer registry
tracer_data
type containing tracer data and pointer into tracer registry
ind_tr
Indices returned by aof_set_coupler_flux if it is used and the surface tracer concentrations are to be provided to the coupler.
diag
A structure that is used to regulate the timing of diagnostic output.
restart_CSp
A pointer to the restart control structure
tr_desc
Descriptions and metadata for the tracers
tracers_may_reinit
If true the tracers may be initialized if not found in a restart file
fesedflux_file
name of [netCDF] file containing iron sediment flux
fesedfluxred_file
name of [netCDF] file containing reduced iron sediment flux
feventflux_file
name of [netCDF] file containing iron vent flux
d14c_dataset
File and time axis information for d14c forcing
d14c_bands
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
id for diagnostic field with d14c forcing
read_riv_fluxes
If true, use river fluxes supplied from an input file. This is temporary, we will always read river fluxes
riv_flux_dataset
File and time axis information for river fluxes
restoring_source
location of tracer restoring data valid values: file, none
restoring_nz
number of levels in tracer restoring file
restoring_z_edges
The depths of the cell interfaces in the tracer restoring file [Z ~> m]
restoring_dz
The thickness of the cell layers in the tracer restoring file [H ~> m]
restoring_timescale_nz
number of levels in tracer restoring timescale file
restoring_timescale_z_edges
The depths of the cell interfaces in the tracer restoring timescale file [Z ~> m]
restoring_timescale_dz
The thickness of the cell layers in the tracer restoring timescale file [H ~> m]
restoring_I_tau_source
location of inverse restoring timescale data valid values: file, grid_dependent
restoring_file
name of [netCDF] file containing tracer restoring data
restoring_remapCS
Remapping parameters and work arrays for tracer restoring / timescale
restoring_I_tau_file
name of [netCDF] file containing inverse restoring timescale
restoring_I_tau_var_name
name of field containing inverse restoring timescale
marbl_settings_file
name of [text] file containing MARBL settings
bot_flux_mix_thickness
for bottom flux -> tendency conversion, assume uniform mixing over bottom layer of prescribed thickness [Z ~> m]
Ibfmt
Reciprocal of bot_flux_mix_thickness [Z-1 ~> m-1]
surface_flux_diags
collect surface flux diagnostics from all columns before posting
interior_tendency_diags
collect tendency diagnostics from all columns before posting
surface_flux_saved_state
surface_flux saved state
interior_tendency_saved_state
interior_tendency saved state
tracer_inds
Indices to tracers that will have river fluxes added to STF
Need to store global output from both marbl_instance%surface_flux_compute() and marbl_instance%interior_tendency_compute(). For the former, just need id to register because we already copy data into CS%STF; latter requires copying data and indices so currently using temp_MARBL_diag for that.
id_surface_flux_out
register_diag indices for surface_flux output
id_surface_flux_from_salt_flux
register_diag indices for surface_flux from salt_flux
interior_tendency_out
collect interior tendencies for diagnostic output
interior_tendency_out_zint
vertical integral of interior tendencies (full column)
interior_tendency_out_zint_100m
vertical integral of interior tendencies (top 100m)
bot_flux_to_tend_id
register_diag index for BOT_FLUX_TO_TEND
fracr_cat_id
register_diag index for per-category ice fraction
qsw_cat_id
register_diag index for per-category shortwave
DIC_salt_ratio
ratio to convert salt surface flux to DIC surface flux [conc ppt-1]
ALK_salt_ratio
ratio to convert salt surface flux to ALK surface flux [conc ppt-1]
STF
surface fluxes returned from MARBL to use in tracer_vertdiff (dims: i, j, tracer) [conc Z T-1 ~> conc m s-1]
SFO
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
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
index of MARBL forcing field array to copy 10-m wind (squared) into
sss_ind
index of MARBL forcing field array to copy sea surface salinity into
sst_ind
index of MARBL forcing field array to copy sea surface temperature into
ifrac_ind
index of MARBL forcing field array to copy ice fraction into
dust_dep_ind
index of MARBL forcing field array to copy dust flux into
fe_dep_ind
index of MARBL forcing field array to copy iron flux into
nox_flux_ind
index of MARBL forcing field array to copy NOx flux into
nhy_flux_ind
index of MARBL forcing field array to copy NHy flux into
atmpress_ind
index of MARBL forcing field array to copy atmospheric pressure into
xco2_ind
index of MARBL forcing field array to copy CO2 flux into
xco2_alt_ind
index of MARBL forcing field array to copy CO2 flux (alternate CO2) into
d14c_ind
index of MARBL forcing field array to copy d14C into
external_field types for river fluxes (added to surface fluxes)
id_din_riv
id for time_interp_external.
id_don_riv
id for time_interp_external.
id_dip_riv
id for time_interp_external.
id_dop_riv
id for time_interp_external.
id_dsi_riv
id for time_interp_external.
id_dfe_riv
id for time_interp_external.
id_dic_riv
id for time_interp_external.
id_alk_riv
id for time_interp_external.
id_doc_riv
id for time_interp_external.
external_field type for d14c (needed if abio_dic_on is True)
id_d14c
id for time_interp_external.
Indices for river fluxes (diagnostics)
no3_riv_flux
NO3 riverine flux
po4_riv_flux
PO4 riverine flux
don_riv_flux
DON riverine flux
donr_riv_flux
DONr riverine flux
dop_riv_flux
DOP riverine flux
dopr_riv_flux
DOPr riverine flux
sio3_riv_flux
SiO3 riverine flux
fe_riv_flux
Fe riverine flux
doc_riv_flux
DOC riverine flux
docr_riv_flux
DOCr riverine flux
alk_riv_flux
ALK riverine flux
alk_alt_co2_riv_flux
ALK (alternate CO2) riverine flux
dic_riv_flux
DIC riverine flux
dic_alt_co2_riv_flux
DIC (alternate CO2) riverine flux
Indices for forcing fields required to compute interior tendencies
dustflux_ind
index of MARBL forcing field array to copy dust flux into
PAR_col_frac_ind
index of MARBL forcing field array to copy PAR column fraction into
surf_shortwave_ind
index of MARBL forcing field array to copy surface shortwave into
potemp_ind
index of MARBL forcing field array to copy potential temperature into
salinity_ind
index of MARBL forcing field array to copy salinity into
pressure_ind
index of MARBL forcing field array to copy pressure into
fesedflux_ind
index of MARBL forcing field array to copy iron sediment flux into
fesedfluxred_ind
index of MARBL forcing field array to copy reduced iron sediment flux into
feventflux_ind
index of MARBL forcing field array to copy iron vent flux into
o2_scalef_ind
index of MARBL forcing field array to copy O2 scale length into
remin_scalef_ind
index of MARBL forcing field array to copy remin scale length into
id_tracer_restoring
id number for time_interp_external
tracer_restoring_ind
index of MARBL forcing field to copy per-tracer restoring field into
tracer_I_tau_ind
index of MARBL forcing field to copy per-tracer inverse restoring timescale into
Memory for storing river fluxes, tracer restoring fields, and abiotic forcing
d14c
d14c forcing for abiotic DIC and carbon isotope tracer modules [mmol m-3 s-1]
RIV_FLUXES
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
name of variable being restored
I_tau
inverse restoring timescale for marbl tracers (dims: i, j, k) [s-1]
restoring_in
Restoring fields read from file (dims: i, j, restoring_nz, restoring_cnt) [tracer units]
Number of surface flux outputs as well as specific indices for each one
sfo_cnt
number of surface flux outputs from MARBL
ito_cnt
number of interior tendency outputs from MARBL
flux_co2_ind
index to co2 flux surface flux output
total_Chl_ind
index to total chlorophyll interior tendency output
fesedflux_scale_factor
scale factor for iron sediment flux [mmol umol-1 d s-1]
fesedflux_nz
number of levels in iron sediment flux file
fesedflux_in
Field to read iron sediment flux into [conc m s-1]
fesedfluxred_in
Field to read reduced iron sediment flux into [conc m s-1]
feventflux_in
Field to read iron vent flux into [conc m s-1]
fesedflux_z_edges
The depths of the cell interfaces in the input data [Z ~> m]
fesedflux_dz
The thickness of the cell layers in the input data [H ~> m]
Functions/Subroutine Documentation
- subroutine 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
Callees call graph
Text view
marbl_tracers::configure_marbl_tracers → marbl_tracers::print_marbl_log
marbl_tracers::configure_marbl_tracers → mom_coms_infra::interface::broadcast
marbl_tracers::configure_marbl_tracers → mom_coms_infra::root_pe
marbl_tracers::configure_marbl_tracers → mom_error_handler::mom_error
marbl_tracers::configure_marbl_tracers → mom_error_infra::is_root_pe
marbl_tracers::configure_marbl_tracers → mom_file_parser::interface::get_param
marbl_tracers::configure_marbl_tracers → mom_file_parser::interface::log_version
Callers call graph
- function 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 [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
Callees call graph
Text view
marbl_tracers::register_marbl_tracers → atmos_ocean_fluxes_mod::aof_set_coupler_flux
marbl_tracers::register_marbl_tracers → marbl_tracers::configure_marbl_tracers
marbl_tracers::register_marbl_tracers → marbl_tracers::set_riv_flux_tracer_inds
marbl_tracers::register_marbl_tracers → marbl_tracers::setup_saved_state
marbl_tracers::register_marbl_tracers → mom_error_handler::mom_error
marbl_tracers::register_marbl_tracers → mom_file_parser::interface::get_param
marbl_tracers::register_marbl_tracers → mom_file_parser::interface::log_param
marbl_tracers::register_marbl_tracers → mom_file_parser::interface::log_version
marbl_tracers::register_marbl_tracers → mom_interpolate::forcing_timeseries_set_time_type_vars
marbl_tracers::register_marbl_tracers → mom_io::query_vardesc
marbl_tracers::register_marbl_tracers → mom_remapping::initialize_remapping
marbl_tracers::register_marbl_tracers → mom_restart::interface::register_restart_field
marbl_tracers::register_marbl_tracers → mom_string_functions::slasher
marbl_tracers::register_marbl_tracers → mom_tracer_registry::register_tracer
marbl_tracers::register_marbl_tracers → mom_tracer_z_init::read_z_edges
Callers call graph
- subroutine initialize_MARBL_tracers(restart, day, G, GV, US, h, param_file, diag, OBC, CS, sponge_CSp)
This subroutine initializes the CS%ntr 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.
Callees call graph
Text view
marbl_tracers::initialize_marbl_tracers → marbl_tracers::register_marbl_diags
marbl_tracers::initialize_marbl_tracers → mom_diag_mediator::register_diag_field
marbl_tracers::initialize_marbl_tracers → mom_error_handler::mom_error
marbl_tracers::initialize_marbl_tracers → mom_interp_infra::init_extern_field
marbl_tracers::initialize_marbl_tracers → mom_io::interface::mom_read_data
marbl_tracers::initialize_marbl_tracers → mom_io::query_vardesc
marbl_tracers::initialize_marbl_tracers → mom_restart::interface::query_initialized
marbl_tracers::initialize_marbl_tracers → mom_tracer_initialization_from_z::mom_initialize_tracer_from_z
marbl_tracers::initialize_marbl_tracers → mom_tracer_z_init::read_z_edges
Callers call graph
- subroutine 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
Callees call graph
Callers call graph
- subroutine 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
Callees call graph
Callers call graph
- subroutine MARBL_tracers_column_physics(h_old, ea, eb, fluxes, dt, G, GV, US, CS, prediabatic_T, prediabatic_S, 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].
ea [in]
an array to which the amount of fluid entrained from the layer above during this call will be added [H ~> m or kg m-2].
eb [in]
an array to which the amount of fluid entrained from the layer below during this call will be added [H ~> m or kg m-2].
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.
prediabatic_T [in]
Temperature prior to calling diabatic driver [C ~> degC]
prediabatic_S [in]
Salinity prior to calling diabatic driver [S ~> ppt]
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]
Callees call graph
Text view
marbl_tracers::marbl_tracers_column_physics → marbl_tracers::print_marbl_log
marbl_tracers::marbl_tracers_column_physics → mom_checksums::interface::hchksum
marbl_tracers::marbl_tracers_column_physics → mom_cvmix_kpp::kpp_nonlocaltransport
marbl_tracers::marbl_tracers_column_physics → mom_diag_mediator::interface::post_data
marbl_tracers::marbl_tracers_column_physics → mom_error_handler::mom_error
marbl_tracers::marbl_tracers_column_physics → mom_remapping::reintegrate_column
marbl_tracers::marbl_tracers_column_physics → mom_remapping::remapping_core_h
marbl_tracers::marbl_tracers_column_physics → mom_tracer_diabatic::applytracerboundaryfluxesinout
marbl_tracers::marbl_tracers_column_physics → mom_tracer_diabatic::tracer_vertdiff
Callers call graph
- subroutine 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
riv_flux_in
The field read in from forcing file with time dimension [mmol m-2 s-1]
Time_forcing
For reading river flux fields, we use a modified version of Time
Callees call graph
Callers call graph
- function 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 [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.
MARBL_tracers_stock
Return value: the number of stocks calculated here.
Callees call graph
Callers call graph
- subroutine 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.
Callers call graph
- subroutine 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.
Callers call graph
- subroutine 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.
Callers call graph
subroutine set_riv_flux_tracer_inds(CS)
- Parameters
CS [inout]
The MARBL tracers control structure
Callers call graph
- subroutine 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