MOM6
|
This tracer package dyes flow through open boundaries.
By Kate Hedstrom, 2017, copied from DOME tracers and also dye_example.
This file contains an example of the code that is needed to set up and use a set of dynamically passive tracers. These tracers dye the inflowing water, one per open boundary segment.
A single subroutine is called from within each file to register each of the tracers for reinitialization and advection and to register the subroutine that initializes the tracers and set up their output and the subroutine that does any tracer physics or chemistry along with diapycnal mixing (included here because some tracers may float or swim vertically or dye diapycnal processes).
Data Types | |
type | dyed_obc_tracer_cs |
The control structure for the dyed_obc tracer package. More... | |
Functions/Subroutines | |
logical function, public | register_dyed_obc_tracer (HI, GV, param_file, CS, tr_Reg, restart_CS) |
Register tracer fields and subroutines to be used with MOM. More... | |
subroutine, public | initialize_dyed_obc_tracer (restart, day, G, GV, h, diag, OBC, CS) |
Initializes the CSntr tracer fields in tr(:,:,:,:) and sets up the tracer output. More... | |
subroutine, public | dyed_obc_tracer_column_physics (h_old, h_new, ea, eb, fluxes, dt, G, GV, US, CS, 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. This is a simple example of a set of advected passive tracers. More... | |
subroutine, public | dyed_obc_tracer_end (CS) |
Clean up memory allocations, if any. More... | |
subroutine, public dyed_obc_tracer::dyed_obc_tracer_column_physics | ( | real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in) | h_old, |
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in) | h_new, | ||
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in) | ea, | ||
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in) | eb, | ||
type(forcing), intent(in) | fluxes, | ||
real, intent(in) | dt, | ||
type(ocean_grid_type), intent(in) | G, | ||
type(verticalgrid_type), intent(in) | GV, | ||
type(unit_scale_type), intent(in) | US, | ||
type(dyed_obc_tracer_cs), pointer | CS, | ||
real, intent(in), optional | evap_CFL_limit, | ||
real, intent(in), optional | minimum_forcing_depth | ||
) |
This subroutine applies diapycnal diffusion and any other column tracer physics or chemistry to the tracers from this file. This is a simple example of a set of advected passive tracers.
The arguments to this subroutine are redundant in that h_new(k) = h_old(k) + ea(k) - eb(k-1) + eb(k) - ea(k+1)
[in] | g | The ocean's grid structure |
[in] | gv | The ocean's vertical grid structure |
[in] | h_old | Layer thickness before entrainment [H ~> m or kg m-2]. |
[in] | h_new | Layer thickness after entrainment [H ~> m or kg m-2]. |
[in] | ea | an array to which the amount of fluid entrained |
[in] | eb | an array to which the amount of fluid entrained |
[in] | fluxes | A structure containing pointers to thermodynamic and tracer forcing fields. Unused fields have NULL ptrs. |
[in] | dt | The amount of time covered by this call [T ~> s] |
[in] | us | A dimensional unit scaling type |
cs | The control structure returned by a previous call to dyed_obc_register_tracer. | |
[in] | evap_cfl_limit | Limit on the fraction of the water that can be fluxed out of the top layer in a timestep [nondim] |
[in] | minimum_forcing_depth | The smallest depth over which fluxes can be applied [H ~> m or kg m-2] |
Definition at line 205 of file dyed_obc_tracer.F90.
References mom_tracer_diabatic::applytracerboundaryfluxesinout(), and mom_tracer_diabatic::tracer_vertdiff().
subroutine, public dyed_obc_tracer::dyed_obc_tracer_end | ( | type(dyed_obc_tracer_cs), pointer | CS | ) |
Clean up memory allocations, if any.
cs | The control structure returned by a previous call to dyed_obc_register_tracer. |
Definition at line 259 of file dyed_obc_tracer.F90.
subroutine, public dyed_obc_tracer::initialize_dyed_obc_tracer | ( | logical, intent(in) | restart, |
type(time_type), intent(in), target | day, | ||
type(ocean_grid_type), intent(in) | G, | ||
type(verticalgrid_type), intent(in) | GV, | ||
real, dimension(szi_(g),szj_(g),szk_(g)), intent(in) | h, | ||
type(diag_ctrl), intent(in), target | diag, | ||
type(ocean_obc_type), pointer | OBC, | ||
type(dyed_obc_tracer_cs), pointer | CS | ||
) |
Initializes the CSntr tracer fields in tr(:,:,:,:) and sets up the tracer output.
[in] | g | The ocean's grid structure |
[in] | gv | The ocean's vertical grid structure |
[in] | restart | .true. if the fields have already been read from a restart file. |
[in] | day | Time of the start of the run. |
[in] | h | Layer thicknesses [H ~> m or kg m-2] |
[in] | diag | Structure used to regulate diagnostic output. |
obc | Structure specifying open boundary options. | |
cs | The control structure returned by a previous call to dyed_obc_register_tracer. |
Definition at line 136 of file dyed_obc_tracer.F90.
References mom_error_handler::mom_error(), and mom_io::query_vardesc().
logical function, public dyed_obc_tracer::register_dyed_obc_tracer | ( | type(hor_index_type), intent(in) | HI, |
type(verticalgrid_type), intent(in) | GV, | ||
type(param_file_type), intent(in) | param_file, | ||
type(dyed_obc_tracer_cs), pointer | CS, | ||
type(tracer_registry_type), pointer | tr_Reg, | ||
type(mom_restart_cs), pointer | restart_CS | ||
) |
Register tracer fields and subroutines to be used with MOM.
[in] | hi | A horizontal index type structure. |
[in] | gv | The ocean's vertical grid structure |
[in] | param_file | 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 to the tracer registry. | |
restart_cs | A pointer to the restart control structure. |
Definition at line 55 of file dyed_obc_tracer.F90.
References atmos_ocean_fluxes_mod::aof_set_coupler_flux(), mom_error_handler::mom_error(), mom_tracer_registry::register_tracer(), and mom_io::var_desc().