MOM_open_boundary module reference
Controls where open boundary conditions are applied
Data Types
Physical field name strings used by input parameter |
|
Tracer on OBC segment data structure, for putting into a segment tracer registry. |
|
Thickness on OBC segment data structure, with a reservoir |
|
Registry type for tracers on segments |
|
Open boundary segment data structure. Unless otherwise noted, 2-d and 3-d arrays are discretized at the same position as normal velocity points in the middle of the OBC segments. |
|
Open-boundary data |
|
Control structure for open boundaries that read from files. Probably lots to update here. |
|
Type to carry something (what??) for the OBC registry. |
|
Type to carry basic OBC information needed for updating values. |
|
Type to carry OBC information needed for setting segments for OBGC tracers |
Functions/Subroutines
Enables OBC module and reads configuration parameters This routine is called from MOM_initialize_fixed which occurs before the initialization of the vertical coordinate and ALE_init. Therefore segment data are not fully initialized here. The remainder of the segment data are initialized in a later call to update_open_boundary_data |
|
Setup vertical remapping for open boundaries |
|
Determine which physical fields are required for this segment based on boundary-condition type and segment orientation. Also enable groups of physical fields required by tides or thermodynamics. Note the tidal group could be further narrowed based on modes. |
|
Find physical field index from name |
|
Set global flag OBC%any_needs_IO_for_data. |
|
Allocate data (buffer_src, buffer_dst and dz_src) for a field at an OBC segment. |
|
Get and store properties about the fields on the OBC segments and allocate space for reading OBC data from files. In the process, it does funky stuff with the MPI processes. |
|
Determine whether a particular field is descretized at the normal-velocity faces of an open boundary condition segment. |
|
Determine based on its name whether a particular field a barotropic tidal field, for which the third dimension is the tidal constituent rather than a vertical axis |
|
This subroutine sets the sign of the OBC%segnum_u and OBC%segnum_v arrays to indicate the direction of the faces - positive for logically eastern or northern OBCs and neagative for logically western or southern OBCs, or zero on non-OBC points. Also store information about which orientations of OBCs ar on this PE and the range of indices within which the various orientations of OBCs can be found on this PE. |
|
Return an appropriate dimensional scaling factor for input data based on an OBC segment data name [various ~> 1], or 1 for tracers or other fields that do not match one of the specified names. Note that calls to register_segment_tracer can come before or after calls to scale_factor_from_name. |
|
Initize parameters and fields related to the specification of tides at open boundaries. |
|
Define indices for segment and store in hor_index_type using global segment bounds corresponding to q-points |
|
Parse an OBC_SEGMENT_%%% string starting with "I=" and configure placement and type of OBC accordingly |
|
Parse an OBC_SEGMENT_%%% string starting with "J=" and configure placement and type of OBC accordingly |
|
Parse an OBC_SEGMENT_%%% string |
|
Parse an OBC_SEGMENT_%%%_DATA string and determine its fields |
|
Parse an OBC_SEGMENT_%%%_DATA string |
|
Parse all the OBC_SEGMENT_%%%_DATA strings again to see which need tracer reservoirs (all pes need to know). |
|
Do any necessary halo updates on OBC-related fields. |
|
Deallocate open boundary data |
|
Close open boundary data |
|
Sets the slope of bathymetry normal to an open boundary to zero. |
|
Reconcile masks and open boundaries, deallocate OBC on PEs where it is not needed. Also adjust u- and v-point cell area on specified open boundaries and mask all points outside open boundaries. |
|
Initialize the tracer reservoirs values, perhaps only if they have not been set via a restart file. |
|
Initialize the thickness reservoirs values, perhaps only if they have not been set via a restart file. |
|
Record that the tracer reservoirs have been initialized so that their values are not reset later. |
|
Copy radiation and oblique boundary condition coefficients (phase speeds and normalizing denominator) from the global restart arrays into the per-segment arrays. |
|
Copy restart fields OBC%tres_x/y to per-segment tracer reservoir segment%tr_Reg%Tr(m)%tres. |
|
Fill segment%h_Reg from restart fields. |
|
Apply radiation conditions to 3D u,v at open boundaries |
|
Applies OBC values stored in segments to 3d u,v fields |
|
Applies zero values to 3d u,v fields on OBC segments |
|
Calculate the tangential gradient of the normal flow at the boundary q-points. |
|
Return the field number on the segment for the named field, or -1 if there is no field with that name. |
|
Return the tracer index from its name |
|
Allocate segment data fields |
|
Deallocate segment data fields |
|
Set tangential velocities outside of open boundaries to silly values (used for checking the interior state is independent of values outside of the domain). |
|
Set thicknesses outside of open boundaries to silly values (used for checking the interior state is independent of values outside of the domain). |
|
Read and remap segment data for a single field index m. This is the shared per-field subroutine used by read_OBC_dynamics_data and read_OBC_tracer_data. |
|
Read OBC segment data for the dynamical fields, with field indices m=1..NUM_PHYS_FIELDS-2 (U, V, gradients, SSH, and tidal constituents). |
|
Read OBC segment data for tracer fields, with field indices m=NUM_PHYS_FIELDS-1..segment%num_fields (T, S, and BGC tracers). If optional arguments h and tv are not given, it is assumed that segment%dz has been calculated by a prior call to read_OBC_dynamics_data. Otherwise, segment%dz is recalculated with h and tv. The optional argument include_bgc (default .true.) allows BGC fields to be read independently. |
|
Compute segment%dz and segment%dZtot at all OBC segments from the current layer thicknesses. These arrays are the target vertical grid used for remapping OBC data to the model grid. |
|
Update OBC segment dynamical fields: normal/tangential velocity, gradient, SSH, and the thickness reservoir. |
|
Update the OBC segment tracer reservoir from segment%field(m)%buffer_dst for tracer field indices m=NUM_PHYS_FIELDS-1..segment%num_fields. The optional argument include_bgc (default true) allows BGC fields to be updated independently. |
|
Initialize thickness and tracer reservoirs to external value. |
|
Update the OBC ramp value as a function of time. If called with the optional argument activate=.true., record the value of Time as the beginning of the ramp period. |
|
register open boundary objects for boundary updates. |
|
This routine include declares and sets the variable "version". |
|
Add file to OBC registry. |
|
Clean up the file OBC from registry. |
|
Initialize the segment tracer registry. |
|
Initialize all the segment thickness reservoirs. |
|
Register a tracer on an OBC segment, allocate its t and tres arrays, and set the per-tracer inverse length scales (I_Lscale_in/out) that control reservoir relaxation. |
|
Clean up the segment tracer registry. |
|
Clean up the segment thickness object |
|
Registers the temperature and salinity in the segment tracer registry. |
|
Sets the OBC properties of external obgc tracers, such as their source file and field name |
|
Get the OBC properties of external obgc tracers, such as their source file, field name, reservoir length scale factors |
|
Registers a named tracer in the segment tracer registries for the OBC segments on which it is active. |
|
Stores the interior tracer values on the segment, and in some cases also sets the tracer reservoir values. |
|
Set the value of temperatures and salinities on OBC segments |
|
Set the value of temperatures and salinities on OBC segments |
|
Find the region outside of all open boundary segments and make sure it is set to land mask. Gonna need to know global land mask as well to get it right... |
|
flood the cin, cout values |
|
flood the cin, cout values |
|
Register OBC segment data for restarts |
|
Update OBC tracer reservoirs (segment%tr_Reg%Tr%tres) using a backward-Euler implicit step, then copy the result into OBC%tres_x / OBC%tres_y for restart I/O. |
|
Update the OBC thickness reservoirs after the thicknesses have been updated. |
|
Vertically remap the OBC tracer reservoirs and radiation rates that are filtered in time. |
|
Adjust interface heights to fit the bathymetry and diagnose layer thickness. |
|
This is more of a rotate initialization than an actual rotate |
|
Rotate the OBC segment configuration data from the input to model index map. |
|
Return the direction of an OBC segment on after rotation to the new grid. Note that rotate_OBC_seg_direction(rotate_OBC_seg_direction(direction, turns), -turns) = direction. |
|
Return the that the field would have after being rotated by the given number of quarter turns |
|
Allocate an array of data for a field on a segment based on the size of a potentially rotated source array |
|
Write out information about the contents of the OBC control structure |
|
Write checksums and perhaps some or all of the values of all the allocated arrays on the OBC segments. |
|
Write checksums and perhaps some or all of the values of all the allocated arrays on a single OBC segment. |
Detailed Description
This module implements some aspects of internal open boundary conditions in MOM.
A small fragment of the grid is shown below:
j+1 x ^ x ^ x At x: q, CoriolisBu j+1 > o > o > At ^: v, tauy j x ^ x ^ x At >: u, taux j > o > o > At o: h, bathyT, buoy, tr, T, S, Rml, ustar j-1 x ^ x ^ x i-1 i i+1 At x & ^: i i+1 At > & o:
The boundaries always run through q grid points (x).
Type Documentation
- type, public :: OBC_segment_data_type
Physical field name strings used by input parameter
Open boundary segment data from files (mostly).
- Parameters
handle
handle from FMS associated with segment data on disk
dz_handle
handle from FMS associated with segment thicknesses on disk
required
True if this field is required
use_IO
True if segment data is based on file input
name
A name identifier for the segment data. When there is grid rotation, this is the name on the rotated internal grid.
tr_index
If this field is a tracer, its index in registry is stored here.
bgc_tracer
True if this field is a BGC tracer
on_face
If true, this field is discretized on the OBC segment (velocity-point) faces, or if false it as the vorticiy points
scale
A scaling factor for converting input data to the internal units of this field. For salinity this would be in units of [S ppt-1 ~> 1]
buffer_src
buffer for segment data located at cell faces and on the original vertical grid in the internally scaled units for the field in question, such as [L T-1 ~> m s-1] for a velocity or [S ~> ppt] for salinity.
nk_src
Number of vertical levels in the source data
dz_src
vertical grid cell spacing of the incoming segment data in [Z ~> m].
buffer_dst
buffer src data remapped to the target vertical grid in the internally scaled units for the field in question, such as [L T-1 ~> m s-1] for a velocity or [S ~> ppt] for salinity.
value
A constant value for the inflow concentration if not read from file, in the internal units of a field, such as [S ~> ppt] for salinity.
resrv_lfac_in
The reservoir inverse length scale factor for the inward direction per field [nondim]. The general 1/Lscale_in is multiplied by this factor for a specific tracer or thickness.
resrv_lfac_out
The reservoir inverse length scale factor for the outward direction per field [nondim]. The general 1/Lscale_out is multiplied by this factor for a specific tracer or thickness.
- type, public :: OBC_segment_tracer_type
Tracer on OBC segment data structure, for putting into a segment tracer registry.
- Parameters
is_initialized
Reservoir values have been set when True
name
Tracer name used for error messages
ntr_index
Index of segment tracer in the global tracer registry
t
External tracer concentration array in rescaled units, like [S ~> ppt] for salinity.
tres
Tracer reservoir array in rescaled units, like [S ~> ppt] for salinity.
scale
A scaling factor for converting the units of input data, like [S ppt-1 ~> 1] for salinity.
resrv_lfac_in
The reservoir inverse length scale factor for the inward direction per tracer [nondim]. The general 1/Lscale_in is multiplied by this factor for a specific tracer or thickness. Set to -1 to force a zero effective length scale regardless of Tr_InvLscale_in.
resrv_lfac_out
The reservoir inverse length scale factor for the outward direction per tracer [nondim]. The general 1/Lscale_out is multiplied by this factor for a specific tracer or thickness. Set to -1 to force a zero effective length scale regardless of Tr_InvLscale_out.
I_Lscale_in
Per-tracer inverse length scale for flow into the reservoir direction. Three regimes:
Positive: finite length scale; I_Lscale_in = resrv_lfac_in * Tr_InvLscale_in [L-1 ~> m-1].
Zero: infinite length scale; reservoir is frozen [nondim].
Negative (-1): instant-update sentinel (zero effective length scale) [nondim].
I_Lscale_out
Per-tracer inverse length scale for flow out of the reservoir direction. Three regimes:
Positive: finite length scale; I_Lscale_out = resrv_lfac_out * Tr_InvLscale_out [L-1 ~> m-1].
Zero: infinite length scale; reservoir is frozen [nondim].
Negative (-1): instant-update sentinel (zero effective length scale) [nondim].
- type, public :: OBC_segment_thickness_type
Thickness on OBC segment data structure, with a reservoir
- Parameters
is_initialized
Reservoir values have been set when True
name
Thickness name used for error messages
h
Layer thickness array in rescaled units, [Z ~> m].
h_res
Thickness reservoir array in rescaled units, [Z ~> m].
scale
A scaling factor for converting the units of input data, [Z m-1 ~> 1].
fd_index
index of segment thickness in the input fields
- type, public :: segment_tracer_registry_type
Registry type for tracers on segments
- Parameters
ntseg
number of registered tracer segments
Tr
array of registered tracers
locked
New tracers may be registered if locked=.false. When locked=.true.,no more tracers can be registered. Not sure who should lock it or when...
- type, public :: OBC_segment_type
Open boundary segment data structure. Unless otherwise noted, 2-d and 3-d arrays are discretized at the same position as normal velocity points in the middle of the OBC segments.
- Parameters
Flather
If true, applies Flather + Chapman radiation of barotropic gravity waves.
radiation
If true, 1D Orlanksi radiation boundary conditions are applied. If False, a gradient condition is applied.
radiation_tan
If true, 1D Orlanksi radiation boundary conditions are applied to tangential flows.
radiation_grad
If true, 1D Orlanksi radiation boundary conditions are applied to dudv and dvdx.
oblique
Oblique waves supported at radiation boundary.
oblique_tan
If true, 2D radiation boundary conditions are applied to tangential flows.
oblique_grad
If true, 2D radiation boundary conditions are applied to dudv and dvdx.
nudged
Optional supplement to radiation boundary.
nudged_tan
Optional supplement to nudge tangential velocity.
nudged_grad
Optional supplement to nudge normal gradient of tangential velocity.
specified
Boundary normal velocity fixed to external value.
specified_tan
Boundary tangential velocity fixed to external value.
specified_grad
Boundary gradient of tangential velocity fixed to external value.
open
Boundary is open for continuity solver, and there are no other parameterized mass fluxes at the open boundary.
gradient
Zero gradient at boundary.
direction
Boundary faces one of the four directions.
is_N_or_S
True if the OB is facing North or South and exists on this PE.
is_E_or_W
True if the OB is facing East or West and exists on this PE.
is_E_or_W_2
True if the OB is facing East or West anywhere.
field
OBC data
num_fields
number of OBC data fields (e.g. u_normal,u_parallel and eta for Flather)
Is_obc
Starting local i-index of boundary segment, this may be outside of the local PE.
Ie_obc
Ending local i-index of boundary segment, this may be outside of the local PE.
Js_obc
Starting local j-index of boundary segment, this may be outside of the local PE.
Je_obc
Ending local j-index of boundary segment, this may be outside of the local PE.
Velocity_nudging_timescale_in
Nudging timescale on inflow [T ~> s].
Velocity_nudging_timescale_out
Nudging timescale on outflow [T ~> s].
on_pe
true if any portion of the segment is located in this PE's data domain
Htot
The total column thickness [H ~> m or kg m-2] at OBC-points.
dz
The layer vertical extent [Z ~> m] at OBC segment faces.
dZtot
The total column vertical extent [Z ~> m] at OBC segment faces.
normal_vel
The layer velocity normal to the OB segment [L T-1 ~> m s-1].
tangential_vel
The layer velocity tangential to the OB segment [L T-1 ~> m s-1], discretized at the corner points.
tangential_grad
The gradient of the velocity tangential to the OB segment [T-1 ~> s-1], discretized at the corner points.
normal_trans
The layer transport normal to the OB segment [H L2 T-1 ~> m3 s-1].
normal_vel_bt
The barotropic velocity normal to the OB segment [L T-1 ~> m s-1].
normal_trans_bt
The barotropic transport normal the OB segment [H L2 T-1 ~> m3 s-1 or kg s-1].
tidal_vn
The barotropic tidal velocity normal to the OB segment [L T-1 ~> m s-1].
tidal_vt
The barotropic tidal velocity tangential to the OB segment [L T-1 ~> m s-1].
SSH
The sea-surface elevation along the segment [Z ~> m].
tidal_elev
Tidal elevation at the OBC points [Z ~> m]
grad_normal
The gradient of the normal flow along the segment times the grid spacing [L T-1 ~> m s-1], with the first index being the corner-point index along the segment, and the second index being 1 (for values one point into the domain) or 2 (for values along the OBC itself)
grad_tan
The gradient of the tangential flow along the segment times the grid spacing [L T-1 ~> m s-1], with the first index being the velocity/tracer point index along the segment, and the second being 1 for the value 1.5 points inside the domain and 2 for the value half a point inside the domain.
grad_gradient
The gradient normal to the segment of the gradient tangetial to the segment of tangential flow along the segment times the grid spacing [T-1 ~> s-1], with the first index being the velocity/tracer point index along the segment, and the second being 1 for the value 2 points into the domain and 2 for the value 1 point into the domain.
rx_norm_rad
The previous normal phase speed use for EW radiation OBC, in grid points per timestep [nondim]
ry_norm_rad
The previous normal phase speed use for NS radiation OBC, in grid points per timestep [nondim]
rx_norm_obl
The previous x-direction normalized radiation coefficient for either EW or NS oblique OBCs [L2 T-2 ~> m2 s-2]
ry_norm_obl
The previous y-direction normalized radiation coefficient for either EW or NS oblique OBCs [L2 T-2 ~> m2 s-2]
cff_normal
The denominator for oblique radiation of the normal velocity [L2 T-2 ~> m2 s-2]
nudged_normal_vel
The layer velocity normal to the OB segment that values should be nudged towards [L T-1 ~> m s-1].
nudged_tangential_vel
The layer velocity tangential to the OB segment that values should be nudged towards [L T-1 ~> m s-1], discretized at the corner (PV) points.
nudged_tangential_grad
The layer dvdx or dudy towards which nudging can occur [T-1 ~> s-1].
h_Reg
A pointer to the thickness for the segment.
tr_Reg
A pointer to the tracer registry for the segment.
HI
Horizontal index ranges
Tr_InvLscale_out
An effective inverse length scale for restoring the tracer concentration in a fictitious reservoir towards interior values when flow is exiting the domain [L-1 ~> m-1]
Tr_InvLscale_in
An effective inverse length scale for restoring the tracer concentration towards an externally imposed value when flow is entering [L-1 ~> m-1]
Th_InvLscale_out
An effective inverse length scale for restoring the layer thickness in a fictitious reservoir towards interior values when flow is exiting the domain [L-1 ~> m-1]
Th_InvLscale_in
An effective inverse length scale for restoring the layer thickness towards an externally imposed value when flow is entering [L-1 ~> m-1]
- type, public :: ocean_OBC_type
Open-boundary data
- Parameters
number_of_segments
The number of open-boundary segments.
reverse_segment_order
If true, store the segments internally in the reversed order.
ke
The number of model layers
open_u_BCs_exist_globally
True if any zonal velocity points in the global domain use open BCs.
open_v_BCs_exist_globally
True if any meridional velocity points in the global domain use open BCs.
Flather_u_BCs_exist_globally
True if any zonal velocity points in the global domain use Flather BCs.
Flather_v_BCs_exist_globally
True if any meridional velocity points in the global domain use Flather BCs.
oblique_BCs_exist_globally
True if any velocity points in the global domain use oblique BCs.
nudged_u_BCs_exist_globally
True if any velocity points in the global domain use nudged BCs.
nudged_v_BCs_exist_globally
True if any velocity points in the global domain use nudged BCs.
specified_u_BCs_exist_globally
True if any zonal velocity points in the global domain use specified BCs.
specified_v_BCs_exist_globally
True if any meridional velocity points in the global domain use specified BCs.
radiation_BCs_exist_globally
True if radiations BCs are in use anywhere.
user_BCs_set_globally
True if any OBC_USER_CONFIG is set for input from user directory.
update_OBC
Is OBC data time-dependent
update_OBC_seg_data
Is it the time for OBC segment data update for fields that require less frequent update
any_needs_IO_for_data
Is any i/o needed for OBCs globally
vorticity_config
An integer indicating OBC relative vorticity configuration
strain_config
An integer indicating OBC strain configuration
zero_biharmonic
If True, zeros the Laplacian of flow on open boundaries for use in the biharmonic viscosity term.
brushcutter_mode
If True, read data on supergrid.
tracer_x_reservoirs_used
Dimensioned by the number of tracers, set globally, true for those with x reservoirs (needed for restarts).
tracer_y_reservoirs_used
Dimensioned by the number of tracers, set globally, true for those with y reservoirs (needed for restarts).
thickness_x_reservoirs_used
True for thichness reservoirs in x (needed for restarts).
thickness_y_reservoirs_used
True for thichness reservoirs in y (needed for restarts).
ntr
number of tracers
n_tide_constituents
Number of tidal constituents to add to the boundary.
add_tide_constituents
If true, add tidal constituents to the boundary elevation and velocity. Will be set to true if n_tide_constituents > 0.
tide_names
Names of tidal constituents to add to the boundary data.
tide_frequencies
Angular frequencies of chosen tidal constituents [rad T-1 ~> rad s-1].
tide_eq_phases
Equilibrium phases of chosen tidal constituents [rad].
tide_fn
Amplitude modulation of boundary tides by nodal cycle [nondim].
tide_un
Phase modulation of boundary tides by nodal cycle [rad].
add_eq_phase
If true, add the equilibrium phase argument to the specified boundary tidal phase.
add_nodal_terms
If true, insert terms for the 18.6 year modulation when calculating tidal boundary conditions.
time_ref
Reference date (t = 0) for tidal forcing.
tidal_longitudes
Lunar and solar longitudes used to calculate tidal forcing.
segment
List of segment objects.
segnum_u
The absolute value gives the segment number of any OBCs at u-points, while the sign indicates whether they are Eastern (> 0) or Western (< 0) OBCs, with 0 for velocities that are not on an OBC.
segnum_v
The absolute value gives the segment number of any OBCs at v-points, while the sign indicates whether they are Northern (> 0) or Southern (< 0) OBCs, with 0 for velocities that are not on an OBC.
obgc_segments_props
obgc segment properties
num_obgc_tracers
The total number of obgc tracers
gamma_uv
The relative weighting for the baroclinic radiation velocities (or speed of characteristics) at the new time level (1) or the running mean (0) for velocities [nondim]. Valid values range from 0 to 1, with a default of 0.3.
rx_max
The maximum magnitude of the baroclinic radiation velocity (or speed of characteristics) in units of grid points per timestep [nondim].
OBC_pe
Is there an open boundary on this tile?
u_OBCs_on_PE
True if there are any u-point OBCs on this PE, including in its halos.
v_OBCs_on_PE
True if there are any v-point OBCs on this PE, including in its halos.
v_N_OBCs_on_PE
True if there are any northern v-point OBCs on this PE, including in its halos.
v_S_OBCs_on_PE
True if there are any southern v-point OBCs on this PE, including in its halos.
u_E_OBCs_on_PE
True if there are any eastern u-point OBCs on this PE, including in its halos.
Is_u_W_obc
Index ranges on the local PE for the open boundary conditions in various directions
Ie_u_W_obc
Index ranges on the local PE for the open boundary conditions in various directions
js_u_W_obc
Index ranges on the local PE for the open boundary conditions in various directions
je_u_W_obc
Index ranges on the local PE for the open boundary conditions in various directions
Is_u_E_obc
Index ranges on the local PE for the open boundary conditions in various directions
Ie_u_E_obc
Index ranges on the local PE for the open boundary conditions in various directions
js_u_E_obc
Index ranges on the local PE for the open boundary conditions in various directions
je_u_E_obc
Index ranges on the local PE for the open boundary conditions in various directions
is_v_S_obc
Index ranges on the local PE for the open boundary conditions in various directions
ie_v_S_obc
Index ranges on the local PE for the open boundary conditions in various directions
Js_v_S_obc
Index ranges on the local PE for the open boundary conditions in various directions
Je_v_S_obc
Index ranges on the local PE for the open boundary conditions in various directions
is_v_N_obc
Index ranges on the local PE for the open boundary conditions in various directions
ie_v_N_obc
Index ranges on the local PE for the open boundary conditions in various directions
Js_v_N_obc
Index ranges on the local PE for the open boundary conditions in various directions
Je_v_N_obc
Index ranges on the local PE for the open boundary conditions in various directions
remap_z_CS
ALE remapping control structure for z-space data on segments
remap_h_CS
ALE remapping control structure for thickness-based fields on segments
OBC_Reg
Registry type for boundaries
rx_normal
Array storage for normal phase speed for EW radiation OBCs in units of grid points per timestep [nondim]
ry_normal
Array storage for normal phase speed for NS radiation OBCs in units of grid points per timestep [nondim]
rx_oblique_u
X-direction oblique boundary condition radiation speeds squared at u points for restarts [L2 T-2 ~> m2 s-2]
ry_oblique_u
Y-direction oblique boundary condition radiation speeds squared at u points for restarts [L2 T-2 ~> m2 s-2]
rx_oblique_v
X-direction oblique boundary condition radiation speeds squared at v points for restarts [L2 T-2 ~> m2 s-2]
ry_oblique_v
Y-direction oblique boundary condition radiation speeds squared at v points for restarts [L2 T-2 ~> m2 s-2]
cff_normal_u
Denominator for normalizing EW oblique boundary condition radiation rates at u points for restarts [L2 T-2 ~> m2 s-2]
cff_normal_v
Denominator for normalizing NS oblique boundary condition radiation rates at v points for restarts [L2 T-2 ~> m2 s-2]
tres_x
Array storage of tracer reservoirs for restarts, in unscaled units [conc]
tres_y
Array storage of tracer reservoirs for restarts, in unscaled units [conc]
h_res_x
Array storage of thickness reservoirs for restarts, [Z ~> m]
h_res_y
Array storage of thickness reservoirs for restarts, [Z ~> m]
use_h_res
If true, use thickness reservoirs
debug
If true, write verbose checksums for debugging purposes.
nk_OBC_debug
The number of layers of OBC segment data to write out in full when DEBUG_OBCS is true.
silly_h
A silly value of thickness outside of the domain that can be used to test the independence of the OBCs to this external data [Z ~> m].
silly_u
A silly value of velocity outside of the domain that can be used to test the independence of the OBCs to this external data [L T-1 ~> m s-1].
ramp
If True, ramp from zero to the external values for SSH.
ramping_is_activated
True if the ramping has been initialized
ramp_timescale
If ramp is True, use this timescale for ramping [T ~> s].
trunc_ramp_time
If ramp is True, time after which ramp is done [T ~> s].
ramp_value
If ramp is True, where we are on the ramp from zero to one [nondim].
ramp_start_time
Time when model was started.
remap_answer_date
The vintage of the order of arithmetic and expressions to use for remapping. Values below 20190101 recover the remapping answers from 2018, while higher values use more robust forms of the same remapping expressions.
check_reconstruction
Flag for remapping to run checks on reconstruction
check_remapping
Flag for remapping to run internal checks
force_bounds_in_subcell
Flag for remapping to hide overshoot using bounds
om4_remap_via_sub_cells
If true, use the OM4 remapping algorithm
remappingScheme
String selecting the vertical remapping scheme
pass_oblique
Structure for group halo pass
exterior_OBC_bug
If true, use incorrect form of tracers exterior to OBCs.
hor_index_bug
If true, recover set of a horizontal indexing bugs in the OBC code.
reservoir_init_bug
If true, set the OBC tracer reservoirs at the startup of a new run from the interior tracer concentrations regardless of properties that may be explicitly specified for the reservoir concentrations.
ts_needed_bug
If true, recover a bug that temperature and salinity can be ignored even if they are registered tracers in the rest of the model.
ignore_dt_obc_bgc
If true, DT_OBC_SEG_UPDATE_OBGC is ignored and all OBC segment tracer data (T/S and BGC) is updated every tracer advection step. If false, T/S is updated every dynamic step, which is unnecessary, while BGC follows its own update schedule, which may not reproduce across restarts. Once DT_OBC_SEG_UPDATE_OBGC is deprecated, only the "true" path will be needed.
tracer_dz_bug
If true, recover a bug that OBC tracer segment data is read without recomputing segment layer thicknesses using the current layer thicknesses and thermodynamic state.
- type, public :: file_OBC_CS
Control structure for open boundaries that read from files. Probably lots to update here.
- Parameters
OBC_file_used
Placeholder for now to avoid an empty type.
- type, public :: OBC_struct_type
Type to carry something (what??) for the OBC registry.
- Parameters
name
OBC name used for error messages
- type, public :: OBC_registry_type
Type to carry basic OBC information needed for updating values.
- Parameters
nobc
number of registered open boundary types.
OB
array of registered boundary types.
locked
New OBC types may be registered if locked=.false. When locked=.true.,no more boundaries can be registered.
- type, private :: external_tracers_segments_props
Type to carry OBC information needed for setting segments for OBGC tracers
- Parameters
next
pointer to the next node
tracer_name
tracer name
tracer_src_file
tracer source file for BC
tracer_src_field
name of the field in source file to extract BC
lfac_in
multiplicative factor for inbound tracer reservoir length scale [nondim]
lfac_out
multiplicative factor for outbound tracer reservoir length scale [nondim]
Functions/Subroutine Documentation
- subroutine open_boundary_config(G, US, param_file, OBC)
Enables OBC module and reads configuration parameters This routine is called from MOM_initialize_fixed which occurs before the initialization of the vertical coordinate and ALE_init. Therefore segment data are not fully initialized here. The remainder of the segment data are initialized in a later call to update_open_boundary_data
- Parameters
G [inout]
Ocean grid structure
US [in]
A dimensional unit scaling type
param_file [in]
Parameter file handle
OBC
Open boundary control structure
Callees call graph
Text view
mom_open_boundary::open_boundary_config → mom_coms_infra::num_pes
mom_open_boundary::open_boundary_config → mom_error_handler::mom_error
mom_open_boundary::open_boundary_config → mom_file_parser::interface::get_param
mom_open_boundary::open_boundary_config → mom_file_parser::interface::log_version
mom_open_boundary::open_boundary_config → mom_file_parser::interface::read_param
mom_open_boundary::open_boundary_config → mom_interp_infra::time_interp_extern_init
mom_open_boundary::open_boundary_config → mom_open_boundary::initialize_obc_tides
mom_open_boundary::open_boundary_config → mom_open_boundary::mask_outside_obcs
mom_open_boundary::open_boundary_config → mom_open_boundary::open_boundary_dealloc
mom_open_boundary::open_boundary_config → mom_open_boundary::open_boundary_query
mom_open_boundary::open_boundary_config → mom_open_boundary::set_segnum_signs
mom_open_boundary::open_boundary_config → mom_open_boundary::setup_u_point_obc
mom_open_boundary::open_boundary_config → mom_open_boundary::setup_v_point_obc
mom_open_boundary::open_boundary_config → mom_string_functions::remove_spaces
Callers call graph
- subroutine open_boundary_setup_vert(GV, US, OBC)
Setup vertical remapping for open boundaries
- Parameters
GV [in]
Container for vertical grid information
US [in]
A dimensional unit scaling type
OBC
Open boundary control structure
Callees call graph
- subroutine segment_determine_required_fields(segment, tides, temp_salt)
Determine which physical fields are required for this segment based on boundary-condition type and segment orientation. Also enable groups of physical fields required by tides or thermodynamics. Note the tidal group could be further narrowed based on modes.
- Parameters
segment [inout]
OBC segment
tides [in]
Switch for tidal variables
temp_salt [in]
Switch for thermodynamic variables
Callees call graph
Callers call graph
- integer function find_phys_field_index(name)
Find physical field index from name
- Parameters
name [in]
Field name
Callers call graph
- subroutine OBC_any_IO(OBC)
Set global flag OBC%any_needs_IO_for_data.
- Parameters
OBC [inout]
Open boundary control structure
Callers call graph
- subroutine allocate_segment_field_data(field, OBC, segment, US, inputdir, filename, varname, suffix, value, turns, nz)
Allocate data (buffer_src, buffer_dst and dz_src) for a field at an OBC segment.
- Parameters
field [inout]
A field of the segment
OBC [in]
Open boundary control structure
segment [inout]
Segment to work on
US [in]
A dimensional unit scaling type
inputdir [in]
The directory of input files
filename [in]
Input file name
varname [in]
Variable name in the input file
suffix [in]
Variable name suffix, "_segment_xxx"
value [in]
Unscaled specified value of the field [a]
turns [in]
Number of quarter turns of the grid
nz [in]
Default k-axis size in buffer_dst
Callees call graph
Text view
mom_open_boundary::allocate_segment_field_data → mom_error_handler::mom_error
mom_open_boundary::allocate_segment_field_data → mom_interp_infra::init_extern_field
mom_open_boundary::allocate_segment_field_data → mom_io::field_size
mom_open_boundary::allocate_segment_field_data → mom_io_infra::interface::file_exists
mom_open_boundary::allocate_segment_field_data → mom_open_boundary::field_is_on_face
mom_open_boundary::allocate_segment_field_data → mom_open_boundary::field_is_tidal
mom_open_boundary::allocate_segment_field_data → mom_open_boundary::scale_factor_from_name
Callers call graph
- subroutine initialize_segment_data(GV, US, OBC, PF, turns, use_temperature)
Get and store properties about the fields on the OBC segments and allocate space for reading OBC data from files. In the process, it does funky stuff with the MPI processes.
- Parameters
GV [in]
Container for vertical grid information
US [in]
A dimensional unit scaling type
OBC [inout]
Open boundary control structure
PF [in]
Parameter file handle
turns [in]
Number of quarter turns of the grid
use_temperature [in]
If true, temperature and salinity used as state variables.
Callees call graph
Text view
mom_open_boundary::initialize_segment_data → mom_coms_infra::get_pelist
mom_open_boundary::initialize_segment_data → mom_coms_infra::num_pes
mom_open_boundary::initialize_segment_data → mom_coms_infra::pe_here
mom_open_boundary::initialize_segment_data → mom_coms_infra::set_pelist
mom_open_boundary::initialize_segment_data → mom_error_handler::mom_error
mom_open_boundary::initialize_segment_data → mom_file_parser::interface::get_param
mom_open_boundary::initialize_segment_data → mom_open_boundary::allocate_segment_field_data
mom_open_boundary::initialize_segment_data → mom_open_boundary::chksum_obc_segment_data
mom_open_boundary::initialize_segment_data → mom_open_boundary::find_phys_field_index
mom_open_boundary::initialize_segment_data → mom_open_boundary::get_obgc_segments_props
mom_open_boundary::initialize_segment_data → mom_open_boundary::get_tracer_index
mom_open_boundary::initialize_segment_data → mom_open_boundary::obc_any_io
mom_open_boundary::initialize_segment_data → mom_open_boundary::parse_segment_data_str
mom_open_boundary::initialize_segment_data → mom_open_boundary::parse_segment_manifest_str
mom_open_boundary::initialize_segment_data → mom_open_boundary::rotated_field_name
mom_open_boundary::initialize_segment_data → mom_open_boundary::segment_determine_required_fields
mom_open_boundary::initialize_segment_data → mom_string_functions::slasher
- logical function field_is_on_face(name, is_E_or_W)
Determine whether a particular field is descretized at the normal-velocity faces of an open boundary condition segment.
- Parameters
name [in]
The OBC segment data name to interpret
is_E_or_W [in]
This is true for an eastern or western open boundary condition
Callers call graph
- logical function field_is_tidal(name)
Determine based on its name whether a particular field a barotropic tidal field, for which the third dimension is the tidal constituent rather than a vertical axis
- Parameters
name [in]
The OBC segment data name to interpret
- subroutine set_segnum_signs(OBC, G)
This subroutine sets the sign of the OBC%segnum_u and OBC%segnum_v arrays to indicate the direction of the faces - positive for logically eastern or northern OBCs and neagative for logically western or southern OBCs, or zero on non-OBC points. Also store information about which orientations of OBCs ar on this PE and the range of indices within which the various orientations of OBCs can be found on this PE.
- Parameters
OBC [inout]
Open boundary control structure, perhaps on a rotated grid.
G [in]
Ocean grid structure used by OBC
- real function scale_factor_from_name(name, US, Tr_Reg)
Return an appropriate dimensional scaling factor for input data based on an OBC segment data name [various ~> 1], or 1 for tracers or other fields that do not match one of the specified names. Note that calls to register_segment_tracer can come before or after calls to scale_factor_from_name.
- Parameters
name [in]
The OBC segment data name to interpret
US [in]
A dimensional unit scaling type
Tr_Reg
pointer to tracer registry for this segment
Callees call graph
Callers call graph
- subroutine initialize_obc_tides(OBC, US, param_file)
Initize parameters and fields related to the specification of tides at open boundaries.
- Parameters
OBC [inout]
Open boundary control structure
US [in]
A dimensional unit scaling type
param_file [in]
Parameter file handle
tide_ref_date
Reference date (t = 0) for tidal forcing (year, month, day).
nodal_ref_date
Date to calculate nodal modulation for (year, month, day).
tide_constituent_str
List of tidal constituents to include on boundary.
nodal_longitudes
Solar and lunar longitudes for tidal forcing
nodal_time
Model time to calculate nodal modulation for.
c
Index to tidal constituent.
tides
True if astronomical tides are also used.
Callees call graph
Text view
mom_open_boundary::initialize_obc_tides → mom_error_handler::mom_mesg
mom_open_boundary::initialize_obc_tides → mom_file_parser::interface::get_param
mom_open_boundary::initialize_obc_tides → mom_tidal_forcing::astro_longitudes_init
mom_open_boundary::initialize_obc_tides → mom_tidal_forcing::eq_phase
mom_open_boundary::initialize_obc_tides → mom_tidal_forcing::nodal_fu
mom_open_boundary::initialize_obc_tides → mom_tidal_forcing::tidal_frequency
Callers call graph
External calls
- time_manager_mod
set_date (time_manager_mod::set_date)
- subroutine setup_segment_indices(G, seg, Is_obc, Ie_obc, Js_obc, Je_obc)
Define indices for segment and store in hor_index_type using global segment bounds corresponding to q-points
- Parameters
G [in]
grid type
seg [inout]
Open boundary segment
Is_obc [in]
Q-point global i-index of start of segment
Ie_obc [in]
Q-point global i-index of end of segment
Js_obc [in]
Q-point global j-index of start of segment
Je_obc [in]
Q-point global j-index of end of segment
- subroutine setup_u_point_obc(OBC, G, US, segment_str, l_seg, l_seg_io, PF, reentrant_y)
Parse an OBC_SEGMENT_%%% string starting with "I=" and configure placement and type of OBC accordingly
- Parameters
OBC [inout]
Open boundary control structure
G [in]
Ocean grid structure
US [in]
A dimensional unit scaling type
segment_str [in]
A string in form of "I=%,J=%:%,string"
l_seg [in]
The internal segment number
l_seg_io [in]
The segment number used for reading parameters
PF [in]
Parameter file handle
reentrant_y [in]
is the domain reentrant in y?
Callees call graph
Text view
mom_open_boundary::setup_u_point_obc → mom_error_handler::mom_error
mom_open_boundary::setup_u_point_obc → mom_file_parser::interface::get_param
mom_open_boundary::setup_u_point_obc → mom_open_boundary::allocate_obc_segment_data
mom_open_boundary::setup_u_point_obc → mom_open_boundary::parse_segment_str
mom_open_boundary::setup_u_point_obc → mom_open_boundary::setup_segment_indices
Callers call graph
- subroutine setup_v_point_obc(OBC, G, US, segment_str, l_seg, l_seg_io, PF, reentrant_x)
Parse an OBC_SEGMENT_%%% string starting with "J=" and configure placement and type of OBC accordingly
- Parameters
OBC [inout]
Open boundary control structure
G [in]
Ocean grid structure
US [in]
A dimensional unit scaling type
segment_str [in]
A string in form of "J=%,I=%:%,string"
l_seg [in]
The internal segment number
l_seg_io [in]
The segment number used for reading parameters
PF [in]
Parameter file handle
reentrant_x [in]
is the domain reentrant in x?
Callees call graph
Text view
mom_open_boundary::setup_v_point_obc → mom_error_handler::mom_error
mom_open_boundary::setup_v_point_obc → mom_file_parser::interface::get_param
mom_open_boundary::setup_v_point_obc → mom_open_boundary::allocate_obc_segment_data
mom_open_boundary::setup_v_point_obc → mom_open_boundary::parse_segment_str
mom_open_boundary::setup_v_point_obc → mom_open_boundary::setup_segment_indices
Callers call graph
- subroutine parse_segment_str(ni_global, nj_global, segment_str, l, m, n, action_str, reentrant)
Parse an OBC_SEGMENT_%%% string
- Parameters
ni_global [in]
Number of h-points in zonal direction
nj_global [in]
Number of h-points in meridional direction
segment_str [in]
A string in form of "I=l,J=m:n,string" or "J=l,I=m,n,string"
l [out]
The value of I=l, if segment_str begins with I=l, or the value of J=l
m [out]
The value of J=m, if segment_str begins with I=, or the value of I=m
n [out]
The value of J=n, if segment_str begins with I=, or the value of I=n
action_str [out]
The "string" part of segment_str
reentrant [in]
is domain reentrant in relevant direction?
word1
Words delineated by commas in a string in form of "I=%,J=%:%,string"
word2
Words delineated by commas in a string in form of "I=%,J=%:%,string"
m_word
Words delineated by commas in a string in form of "I=%,J=%:%,string"
n_word
Words delineated by commas in a string in form of "I=%,J=%:%,string"
max_words
maximum number of OBC types per segment
l_max
Either ni_global or nj_global, depending on whether segment_str begins with "I=" or "J="
mn_max
Either nj_global or ni_global, depending on whether segment_str begins with "I=" or "J="
Callees call graph
Callers call graph
integer function interpret_int_expr(string, imax)
- Parameters
string [in]
Integer in form or %I, N or N-%I
imax [in]
Value to replace 'N' with
Callees call graph
Callers call graph
- subroutine parse_segment_manifest_str(segment_str, num_fields, fields)
Parse an OBC_SEGMENT_%%%_DATA string and determine its fields
- Parameters
segment_str [in]
A string in form of "VAR1=file:foo1.nc(varnam1),VAR2=file:foo2.nc(varnam2),..."
num_fields [out]
The number of fields in the segment data
fields [out]
List of fieldnames for each segment
Callees call graph
- subroutine parse_segment_data_str(segment_str, idx, var, value, filename, fieldname)
Parse an OBC_SEGMENT_%%%_DATA string
- Parameters
segment_str [in]
A string in form of "VAR1=file:foo1.nc(varnam1),VAR2=file:foo2.nc(varnam2),..."
idx [in]
Index of segment_str record
var [in]
The name of the variable for which parameters are needed
filename [out]
The name of the input file if using "file" method
fieldname [out]
The name of the variable in the input file if using "file" method
value [out]
A constant value if using the "value" method in various units but without the internal rescaling [various units]
Callees call graph
- subroutine parse_for_tracer_reservoirs(OBC, PF, use_temperature)
Parse all the OBC_SEGMENT_%%%_DATA strings again to see which need tracer reservoirs (all pes need to know).
- Parameters
OBC [inout]
Open boundary control structure
PF [in]
Parameter file handle
use_temperature [in]
If true, T and S are used
Callees call graph
Callers call graph
- subroutine open_boundary_halo_update(G, OBC)
Do any necessary halo updates on OBC-related fields.
- Parameters
G [in]
Ocean grid structure
OBC
Open boundary control structure
Callees call graph
Text view
mom_open_boundary::open_boundary_halo_update → mom_cpu_clock_infra::cpu_clock_id
mom_open_boundary::open_boundary_halo_update → mom_domain_infra::do_group_pass
mom_open_boundary::open_boundary_halo_update → mom_domain_infra::interface::create_group_pass
mom_open_boundary::open_boundary_halo_update → mom_domain_infra::interface::pass_var
mom_open_boundary::open_boundary_halo_update → mom_domain_infra::interface::pass_vector
logical function open_boundary_query(OBC, apply_open_OBC, apply_specified_OBC, apply_Flather_OBC, apply_nudged_OBC, needs_ext_seg_data)
- Parameters
OBC
Open boundary control structure
apply_open_OBC [in]
Returns True if open_*_BCs_exist_globally is true
apply_specified_OBC [in]
Returns True if specified_*_BCs_exist_globally is true
apply_Flather_OBC [in]
Returns True if Flather_*_BCs_exist_globally is true
apply_nudged_OBC [in]
Returns True if nudged_*_BCs_exist_globally is true
needs_ext_seg_data [in]
Returns True if external segment data needed
Callers call graph
Text view
mom_barotropic::barotropic_init → mom_open_boundary::open_boundary_query
mom_barotropic::btstep → mom_open_boundary::open_boundary_query
mom_dynamics_split_rk2::step_mom_dyn_split_rk2 → mom_open_boundary::open_boundary_query
mom_dynamics_split_rk2b::step_mom_dyn_split_rk2b → mom_open_boundary::open_boundary_query
mom_open_boundary::open_boundary_config → mom_open_boundary::open_boundary_query
- subroutine open_boundary_dealloc(OBC)
Deallocate open boundary data
- Parameters
OBC
Open boundary control structure
Callees call graph
- subroutine open_boundary_end(OBC)
Close open boundary data
- Parameters
OBC
Open boundary control structure
Callees call graph
Callers call graph
- subroutine open_boundary_impose_normal_slope(OBC, G, depth)
Sets the slope of bathymetry normal to an open boundary to zero.
- Parameters
OBC
Open boundary control structure
G [in]
Ocean grid structure
depth [inout]
Bathymetry at h-points, in [Z ~> m] or other units
Callers call graph
- subroutine open_boundary_impose_land_mask(OBC, G, areaCu, areaCv, US)
Reconcile masks and open boundaries, deallocate OBC on PEs where it is not needed. Also adjust u- and v-point cell area on specified open boundaries and mask all points outside open boundaries.
- Parameters
OBC
Open boundary control structure
G [inout]
Ocean grid structure
US [in]
A dimensional unit scaling type
areaCu [inout]
Area of a u-cell [L2 ~> m2]
areaCv [inout]
Area of a u-cell [L2 ~> m2]
Callers call graph
- subroutine setup_OBC_tracer_reservoirs(G, GV, OBC, restart_CS)
Initialize the tracer reservoirs values, perhaps only if they have not been set via a restart file.
- Parameters
G [in]
Ocean grid structure
GV [in]
The ocean's vertical grid structure
OBC [inout]
Open boundary control structure
restart_CS [in]
MOM restart control structure
Callees call graph
- subroutine setup_OBC_thickness_reservoirs(G, GV, OBC, restart_CS)
Initialize the thickness reservoirs values, perhaps only if they have not been set via a restart file.
- Parameters
G [in]
Ocean grid structure
GV [in]
The ocean's vertical grid structure
OBC [inout]
Open boundary control structure
restart_CS [in]
MOM restart control structure
Callees call graph
Callers call graph
- subroutine set_initialized_OBC_tracer_reservoirs(G, OBC, restart_CS)
Record that the tracer reservoirs have been initialized so that their values are not reset later.
- Parameters
G [in]
Ocean grid structure
OBC [in]
Open boundary control structure
restart_CS [inout]
MOM restart control structure
Callees call graph
Callers call graph
- subroutine copy_OBC_radiation_coefs(OBC)
Copy radiation and oblique boundary condition coefficients (phase speeds and normalizing denominator) from the global restart arrays into the per-segment arrays.
- Parameters
OBC
Open boundary control structure
- subroutine copy_OBC_tracer_reservoirs(OBC)
Copy restart fields OBC%tres_x/y to per-segment tracer reservoir segment%tr_Reg%Tr(m)%tres.
- Parameters
OBC
Open boundary control structure
- subroutine copy_OBC_thickness_reservoirs(OBC, G, GV)
Fill segment%h_Reg from restart fields.
- Parameters
G [inout]
Ocean grid structure
GV [in]
The ocean's vertical grid structure
OBC
Open boundary control structure
Callees call graph
- subroutine radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, G, GV, US, dt)
Apply radiation conditions to 3D u,v at open boundaries
- Parameters
G [inout]
Ocean grid structure
GV [in]
The ocean's vertical grid structure
OBC
Open boundary control structure
u_new [inout]
On exit, new u values on open boundaries On entry, the old time-level u but including barotropic accelerations [L T-1 ~> m s-1].
u_old [in]
Original unadjusted u [L T-1 ~> m s-1]
v_new [inout]
On exit, new v values on open boundaries. On entry, the old time-level v but including barotropic accelerations [L T-1 ~> m s-1].
v_old [in]
Original unadjusted v [L T-1 ~> m s-1]
US [in]
A dimensional unit scaling type
dt [in]
Appropriate timestep [T ~> s]
Callees call graph
Text view
mom_open_boundary::radiation_open_bdry_conds → mom_checksums::interface::uvchksum
mom_open_boundary::radiation_open_bdry_conds → mom_domain_infra::interface::pass_vector
mom_open_boundary::radiation_open_bdry_conds → mom_open_boundary::chksum_obc_segments
mom_open_boundary::radiation_open_bdry_conds → mom_open_boundary::gradient_at_q_points
mom_open_boundary::radiation_open_bdry_conds → mom_open_boundary::open_boundary_apply_normal_flow
- subroutine open_boundary_apply_normal_flow(OBC, G, GV, u, v)
Applies OBC values stored in segments to 3d u,v fields
- Parameters
OBC
Open boundary control structure
G [inout]
Ocean grid structure
GV [in]
The ocean's vertical grid structure
u [inout]
u field to update on open boundaries [L T-1 ~> m s-1]
v [inout]
v field to update on open boundaries [L T-1 ~> m s-1]
Callers call graph
- subroutine open_boundary_zero_normal_flow(OBC, G, GV, u, v)
Applies zero values to 3d u,v fields on OBC segments
- Parameters
OBC
Open boundary control structure
G [inout]
Ocean grid structure
GV [in]
The ocean's vertical grid structure
u [inout]
u field to update on open boundaries [arbitrary]
v [inout]
v field to update on open boundaries [arbitrary]
Callers call graph
Text view
mom_dynamics_split_rk2::step_mom_dyn_split_rk2 → mom_open_boundary::open_boundary_zero_normal_flow
mom_dynamics_split_rk2b::step_mom_dyn_split_rk2b → mom_open_boundary::open_boundary_zero_normal_flow
mom_dynamics_unsplit::step_mom_dyn_unsplit → mom_open_boundary::open_boundary_zero_normal_flow
mom_dynamics_unsplit_rk2::step_mom_dyn_unsplit_rk2 → mom_open_boundary::open_boundary_zero_normal_flow
- subroutine gradient_at_q_points(G, GV, segment, uvel, vvel)
Calculate the tangential gradient of the normal flow at the boundary q-points.
- Parameters
G [in]
Ocean grid structure
GV [in]
The ocean's vertical grid structure
segment [inout]
OBC segment structure
uvel [in]
zonal velocity [L T-1 ~> m s-1]
vvel [in]
meridional velocity [L T-1 ~> m s-1]
Callers call graph
- function lookup_seg_field(OBC_seg, field)
Return the field number on the segment for the named field, or -1 if there is no field with that name.
- Parameters
OBC_seg [in]
OBC segment
field [in]
The field name
- function get_tracer_index(OBC_seg, tr_name)
Return the tracer index from its name
- Parameters
OBC_seg
OBC segment
tr_name [in]
The field name
- subroutine allocate_OBC_segment_data(OBC, segment)
Allocate segment data fields
- Parameters
OBC [in]
Open boundary structure
segment [inout]
Open boundary segment
- subroutine deallocate_OBC_segment_data(segment)
Deallocate segment data fields
- Parameters
segment [inout]
Open boundary segment
Callees call graph
Callers call graph
- subroutine open_boundary_test_extern_uv(G, GV, OBC, u, v)
Set tangential velocities outside of open boundaries to silly values (used for checking the interior state is independent of values outside of the domain).
- Parameters
G [in]
Ocean grid structure
GV [in]
The ocean's vertical grid structure
OBC
Open boundary structure
u [inout]
Zonal velocity [L T-1 ~> m s-1]
v [inout]
Meridional velocity [L T-1 ~> m s-1]
- subroutine open_boundary_test_extern_h(G, GV, OBC, h)
Set thicknesses outside of open boundaries to silly values (used for checking the interior state is independent of values outside of the domain).
- Parameters
G [in]
Ocean grid structure
GV [in]
Ocean vertical grid structure
OBC
Open boundary structure
h [inout]
Layer thickness [H ~> m or kg m-2]
Callers call graph
- subroutine read_OBC_field_data(G, GV, US, OBC, segment, m, Time)
Read and remap segment data for a single field index m. This is the shared per-field subroutine used by read_OBC_dynamics_data and read_OBC_tracer_data.
- Parameters
G [in]
Ocean grid structure
GV [in]
Ocean vertical grid structure
US [in]
A dimensional unit scaling type
OBC
Open boundary structure
segment
Segment whose field is being read
m [in]
Field index within segment%field
Time [in]
Model time
Callees call graph
Text view
mom_open_boundary::read_obc_field_data → mom_array_transform::interface::rotate_array
mom_open_boundary::read_obc_field_data → mom_error_handler::mom_error
mom_open_boundary::read_obc_field_data → mom_interpolate::interface::time_interp_external
mom_open_boundary::read_obc_field_data → mom_open_boundary::adjustsegmentetatofitbathymetry
mom_open_boundary::read_obc_field_data → mom_open_boundary::field_is_tidal
mom_open_boundary::read_obc_field_data → mom_remapping::remapping_core_h
- subroutine read_OBC_dynamics_data(G, GV, US, OBC, tv, h, Time)
Read OBC segment data for the dynamical fields, with field indices m=1..NUM_PHYS_FIELDS-2 (U, V, gradients, SSH, and tidal constituents).
- Parameters
G [in]
Ocean grid structure
GV [in]
Ocean vertical grid structure
US [in]
A dimensional unit scaling type
OBC
Open boundary structure
tv [in]
Thermodynamics structure
h [in]
Thickness [H ~> m or kg m-2]
Time [in]
Model time
Callees call graph
Callers call graph
- subroutine read_OBC_tracer_data(G, GV, US, OBC, Time, h, tv, include_bgc)
Read OBC segment data for tracer fields, with field indices m=NUM_PHYS_FIELDS-1..segment%num_fields (T, S, and BGC tracers). If optional arguments h and tv are not given, it is assumed that segment%dz has been calculated by a prior call to read_OBC_dynamics_data. Otherwise, segment%dz is recalculated with h and tv. The optional argument include_bgc (default .true.) allows BGC fields to be read independently.
- Parameters
G [in]
Ocean grid structure
GV [in]
Ocean vertical grid structure
US [in]
A dimensional unit scaling type
OBC
Open boundary structure
Time [in]
Model time
h [in]
Thickness for recomputing dz [H ~> m or kg m-2]
tv [in]
Thermodynamics structure for recomputing dz
include_bgc [in]
Read BGC tracers
Callees call graph
- subroutine update_OBC_segment_dz(G, GV, US, OBC, h, tv)
Compute segment%dz and segment%dZtot at all OBC segments from the current layer thicknesses. These arrays are the target vertical grid used for remapping OBC data to the model grid.
- Parameters
G [in]
Ocean grid structure
GV [in]
Ocean vertical grid structure
US [in]
A dimensional unit scaling type
OBC
Open boundary structure
h [in]
Thickness [H ~> m or kg m-2]
tv [in]
Thermodynamics structure
Callees call graph
- subroutine update_OBC_dynamics_data(G, GV, US, OBC, h, Time)
Update OBC segment dynamical fields: normal/tangential velocity, gradient, SSH, and the thickness reservoir.
- Parameters
G [in]
Ocean grid structure
GV [in]
Ocean vertical grid structure
US [in]
A dimensional unit scaling type
OBC
Open boundary structure
h [in]
Thickness [H ~> m or kg m-2]
Time [in]
Model time
Callees call graph
Callers call graph
- subroutine update_OBC_tracer_data(OBC, include_bgc)
Update the OBC segment tracer reservoir from segment%field(m)%buffer_dst for tracer field indices m=NUM_PHYS_FIELDS-1..segment%num_fields. The optional argument include_bgc (default true) allows BGC fields to be updated independently.
- Parameters
OBC
Open boundary structure
include_bgc [in]
Update BGC tracers
- subroutine initialize_OBC_segment_reservoirs(GV, OBC)
Initialize thickness and tracer reservoirs to external value.
- Parameters
GV [in]
Ocean vertical grid structure
OBC
Open boundary structure
Callers call graph
- subroutine update_OBC_ramp(Time, OBC, US, activate)
Update the OBC ramp value as a function of time. If called with the optional argument activate=.true., record the value of Time as the beginning of the ramp period.
- Parameters
Time [in]
Current model time
OBC [inout]
Open boundary structure
US [in]
A dimensional unit scaling type
activate [in]
Specify whether to record the value of Time as the beginning of the ramp period
Callees call graph
Callers call graph
Text view
mom_dynamics_split_rk2::initialize_dyn_split_rk2 → mom_open_boundary::update_obc_ramp
mom_dynamics_split_rk2::step_mom_dyn_split_rk2 → mom_open_boundary::update_obc_ramp
mom_dynamics_split_rk2b::initialize_dyn_split_rk2b → mom_open_boundary::update_obc_ramp
mom_dynamics_split_rk2b::step_mom_dyn_split_rk2b → mom_open_boundary::update_obc_ramp
- subroutine register_OBC(name, param_file, Reg)
register open boundary objects for boundary updates.
- Parameters
name [in]
OBC name used for error messages
param_file [in]
file to parse for model parameter values
Reg
pointer to the tracer registry
Callees call graph
Callers call graph
Text view
dyed_channel_initialization::register_dyed_channel_obc → mom_open_boundary::register_obc
kelvin_initialization::register_kelvin_obc → mom_open_boundary::register_obc
mom_open_boundary::register_file_obc → mom_open_boundary::register_obc
shelfwave_initialization::register_shelfwave_obc → mom_open_boundary::register_obc
tidal_bay_initialization::register_tidal_bay_obc → mom_open_boundary::register_obc
- subroutine OBC_registry_init(param_file, Reg)
This routine include declares and sets the variable "version".
- Parameters
param_file [in]
open file to parse for model parameters
Reg
pointer to OBC registry
Callees call graph
- function register_file_OBC(param_file, CS, US, OBC_Reg)
Add file to OBC registry.
- Parameters
param_file [in]
parameter file.
CS
file control structure.
US [in]
A dimensional unit scaling type
OBC_Reg
OBC registry.
casename
This case's name.
Callees call graph
Callers call graph
- subroutine file_OBC_end(CS)
Clean up the file OBC from registry.
- Parameters
CS
OBC file control structure.
Callers call graph
- subroutine segment_tracer_registry_init(param_file, segment)
Initialize the segment tracer registry.
- Parameters
param_file [in]
open file to parse for model parameters
segment [inout]
the segment
Callees call graph
Callers call graph
- subroutine segment_thickness_reservoir_init(GV, US, OBC, param_file)
Initialize all the segment thickness reservoirs.
- Parameters
param_file [in]
open file to parse for model parameters
GV [in]
ocean vertical grid structure
US [in]
Unit scaling type
OBC
Open boundary structure
Callees call graph
Callers call graph
- subroutine register_segment_tracer(tr_ptr, ntr_index, param_file, GV, segment, OBC_scalar, scale, resrv_lfac_in, resrv_lfac_out)
Register a tracer on an OBC segment, allocate its t and tres arrays, and set the per-tracer inverse length scales (I_Lscale_in/out) that control reservoir relaxation.
- Parameters
GV [in]
ocean vertical grid structure
tr_ptr
Tracer to register; must persist in the caller's control structure for the lifetime of the segment.
ntr_index [in]
index of segment tracer in the global tracer registry
param_file [in]
file to parse for model parameter values
segment [inout]
current segment data structure
OBC_scalar [in]
If present, use this spatially uniform value as the OBC inflow concentration in the tracer's internal units, like [S ~> ppt] for salinity. Mutually exclusive with resrv_lfac_in and resrv_lfac_out.
scale [in]
A scaling factor that should be used with any data that is read in to convert it to the internal units of this tracer, in units like [S ppt-1 ~> 1] for salinity.
resrv_lfac_in [in]
Per-tracer multiplier for the inward reservoir relaxation length scale [nondim].
resrv_lfac_out [in]
Per-tracer multiplier for the outward reservoir relaxation length scale [nondim].
Callees call graph
Callers call graph
Text view
dome_initialization::dome_set_obc_data → mom_open_boundary::register_segment_tracer
dyed_channel_initialization::dyed_channel_set_obc_tracer_data → mom_open_boundary::register_segment_tracer
dyed_obcs_initialization::dyed_obcs_set_obc_data → mom_open_boundary::register_segment_tracer
mom_open_boundary::register_obgc_segments → mom_open_boundary::register_segment_tracer
mom_open_boundary::register_temp_salt_segments → mom_open_boundary::register_segment_tracer
- subroutine segment_tracer_registry_end(Reg)
Clean up the segment tracer registry.
- Parameters
Reg
pointer to tracer registry
Callers call graph
- subroutine segment_thickness_registry_end(Reg)
Clean up the segment thickness object
- Parameters
Reg
pointer to thickness reservoir
Callers call graph
- subroutine register_temp_salt_segments(GV, US, OBC, tr_Reg, param_file)
Registers the temperature and salinity in the segment tracer registry.
- Parameters
GV [in]
ocean vertical grid structure
US [in]
Unit scaling type
OBC
Open boundary structure
tr_Reg
Tracer registry
param_file [in]
file to parse for model parameter values
Callees call graph
- subroutine set_obgc_segments_props(OBC, tr_name, obc_src_file_name, obc_src_field_name, lfac_in, lfac_out)
Sets the OBC properties of external obgc tracers, such as their source file and field name
- Parameters
OBC
Open boundary structure
tr_name [in]
Tracer name
obc_src_file_name [in]
OBC source file name
obc_src_field_name [in]
name of the field in the source file
lfac_in [in]
factors for tracer reservoir inbound length scales [nondim]
lfac_out [in]
factors for tracer reservoir outbound length scales [nondim]
- subroutine get_obgc_segments_props(node, tr_name, obc_src_file_name, obc_src_field_name, lfac_in, lfac_out)
Get the OBC properties of external obgc tracers, such as their source file, field name, reservoir length scale factors
- Parameters
node
pointer to tracer segment properties
tr_name [out]
Tracer name
obc_src_file_name [out]
OBC source file name
obc_src_field_name [out]
name of the field in the source file
lfac_in [out]
multiplicative factor for inbound reservoir length scale [nondim]
lfac_out [out]
multiplicative factor for outbound reservoir length scale [nondim]
Callers call graph
- subroutine register_obgc_segments(GV, OBC, tr_Reg, param_file, tr_name)
Registers a named tracer in the segment tracer registries for the OBC segments on which it is active.
- Parameters
GV [in]
ocean vertical grid structure
OBC
Open boundary structure
tr_Reg
Tracer registry
param_file [in]
file to parse for model parameter values
tr_name [in]
Tracer name
- subroutine fill_obgc_segments(G, GV, OBC, tr_ptr, tr_name)
Stores the interior tracer values on the segment, and in some cases also sets the tracer reservoir values.
- Parameters
G [inout]
Ocean grid structure
GV [in]
ocean vertical grid structure
OBC
Open boundary structure
tr_ptr
Pointer to tracer field in scaled concentration units, like [S ~> ppt] for salinity.
tr_name [in]
Tracer name
- subroutine fill_temp_salt_segments(G, GV, US, OBC, tv)
Set the value of temperatures and salinities on OBC segments
- Parameters
G [in]
Ocean grid structure
GV [in]
ocean vertical grid structure
US [in]
Unit scaling
OBC
Open boundary structure
tv [in]
Thermodynamics structure
- subroutine fill_thickness_segments(G, GV, US, OBC, h)
Set the value of temperatures and salinities on OBC segments
- Parameters
G [in]
Ocean grid structure
GV [in]
ocean vertical grid structure
US [in]
Unit scaling
OBC
Open boundary structure
h [in]
Layer thicknesses [H ~> m or kg m-2]
Callers call graph
- subroutine mask_outside_OBCs(G, US, param_file, OBC)
Find the region outside of all open boundary segments and make sure it is set to land mask. Gonna need to know global land mask as well to get it right...
- Parameters
G [inout]
Ocean grid structure
param_file [in]
Parameter file handle
OBC
Open boundary structure
US [in]
A dimensional unit scaling type
Callees call graph
Callers call graph
- subroutine flood_fill(G, color, cin, cout, cland)
flood the cin, cout values
- Parameters
G [inout]
Ocean grid structure
color [inout]
For sorting inside from outside [nondim]
cin [in]
color for inside the domain
cout [in]
color for outside the domain
cland [in]
color for inside the land mask
Callees call graph
- subroutine flood_fill2(G, color, cin, cout, cland)
flood the cin, cout values
- Parameters
G [inout]
Ocean grid structure
color [inout]
For sorting inside from outside [nondim]
cin [in]
color for inside the domain
cout [in]
color for outside the domain
cland [in]
color for inside the land mask
Callees call graph
- subroutine open_boundary_register_restarts(HI, GV, US, OBC, Reg, param_file, restart_CS, use_temperature)
Register OBC segment data for restarts
- Parameters
HI [in]
Horizontal indices
GV
Container for vertical grid information
US [in]
A dimensional unit scaling type
OBC
OBC data structure, data intent(inout)
Reg
pointer to tracer registry
param_file [in]
Parameter file handle
restart_CS [inout]
MOM restart control structure
use_temperature [in]
If true, T and S are used
Callees call graph
Text view
mom_open_boundary::open_boundary_register_restarts → mom_error_handler::mom_error
mom_open_boundary::open_boundary_register_restarts → mom_io::var_desc
mom_open_boundary::open_boundary_register_restarts → mom_open_boundary::parse_for_tracer_reservoirs
mom_open_boundary::open_boundary_register_restarts → mom_restart::interface::register_restart_field
mom_open_boundary::open_boundary_register_restarts → mom_restart::interface::register_restart_pair
Callers call graph
- subroutine update_segment_tracer_reservoirs(G, GV, uhr, vhr, h, OBC, Reg)
Update OBC tracer reservoirs (segment%tr_Reg%Tr%tres) using a backward-Euler implicit step, then copy the result into OBC%tres_x / OBC%tres_y for restart I/O.
The reservoir at each boundary cell is nudged toward the adjacent interior tracer (on outflow) or the open-ocean boundary value (on inflow), weighted by the volume flux and the per-tracer inverse length scale I_Lscale. Three regimes, set at registration via I_Lscale_in/out:
Frozen (I_Lscale = 0): tres is unchanged every timestep.
Finite length scale (I_Lscale > 0): tres relaxes toward the interior or boundary value at a rate proportional to the flux and I_Lscale.
Instant update (I_Lscale = -1): tres is immediately replaced by the interior value (outflow) or the boundary value (inflow).
- Parameters
G [in]
The ocean's grid structure
GV [in]
Ocean vertical grid structure
uhr [in]
accumulated volume/mass flux through the zonal face [H L2 ~> m3 or kg]
vhr [in]
accumulated volume/mass flux through the meridional face [H L2 ~> m3 or kg]
h [in]
layer thickness after advection [H ~> m or kg m-2]
OBC
Open boundary structure
Reg
pointer to tracer registry
Callers call graph
- subroutine update_segment_thickness_reservoirs(G, GV, uhr, vhr, h, OBC)
Update the OBC thickness reservoirs after the thicknesses have been updated.
- Parameters
G [in]
The ocean's grid structure
GV [in]
Ocean vertical grid structure
uhr [in]
accumulated volume/mass flux through the zonal face [H L2 ~> m3 or kg]
vhr [in]
accumulated volume/mass flux through the meridional face [H L2 ~> m3 or kg]
h [in]
layer thickness after advection [H ~> m or kg m-2]
OBC
Open boundary structure
- subroutine remap_OBC_fields(G, GV, h_old, h_new, OBC, PCM_cell)
Vertically remap the OBC tracer reservoirs and radiation rates that are filtered in time.
- Parameters
G [in]
The ocean's grid structure
GV [in]
Ocean vertical grid structure
h_old [in]
Thickness of source grid [H ~> m or kg m-2]
h_new [in]
Thickness of destination grid [H ~> m or kg m-2]
OBC
Open boundary structure
PCM_cell [in]
Use PCM remapping in cells where true
Callees call graph
Callers call graph
- subroutine adjustSegmentEtaToFitBathymetry(G, GV, US, segment, fld, at_node)
Adjust interface heights to fit the bathymetry and diagnose layer thickness.
If the bottom most interface is below the topography then the bottom-most layers are contracted to GV%Angstrom_Z. If the bottom most interface is above the topography then the entire column is dilated (expanded) to fill the void.
Remark: There is a (hard-wired) "tolerance" parameter such that the criteria for adjustment must equal or exceed 10cm.
- Parameters
G [in]
The ocean's grid structure
GV [in]
The ocean's vertical grid structure
US [in]
A dimensional unit scaling type
segment [inout]
OBC segment
fld [in]
field index to adjust thickness
at_node [in]
True this point is at the OBC nodes rather than the faces
hTolerance
Tolerance to exceed adjustment criteria [Z ~> m]
Callers call graph
- subroutine rotate_OBC_config(OBC_in, G_in, OBC, G, turns)
This is more of a rotate initialization than an actual rotate
- Parameters
OBC_in [in]
Input OBC
G_in [in]
Input grid
OBC [inout]
Rotated OBC
G [in]
Rotated grid
turns [in]
Number of quarter turns
Callees call graph
Text view
mom_open_boundary::rotate_obc_config → mom_array_transform::interface::rotate_array_pair
mom_open_boundary::rotate_obc_config → mom_open_boundary::allocate_obc_segment_data
mom_open_boundary::rotate_obc_config → mom_open_boundary::rotate_obc_segment_config
mom_open_boundary::rotate_obc_config → mom_open_boundary::set_segnum_signs
- subroutine rotate_OBC_segment_config(segment_in, G_in, segment, G, turns)
Rotate the OBC segment configuration data from the input to model index map.
- Parameters
segment_in [in]
Input OBC segment
G_in [in]
Input grid metric
segment [inout]
Rotated OBC segment
G [in]
Rotated grid metric
turns [in]
Number of quarter turns
Callees call graph
Callers call graph
- function rotate_OBC_segment_direction(direction, turns) result(rotated_dir)
Return the direction of an OBC segment on after rotation to the new grid. Note that rotate_OBC_seg_direction(rotate_OBC_seg_direction(direction, turns), -turns) = direction.
- Parameters
direction [in]
The orientation of an OBC segment on the original grid
turns [in]
Number of quarter turns
rotated_dir
An integer encoding the new rotated segment direction
Callers call graph
Text view
kelvin_initialization::kelvin_set_obc_data → mom_open_boundary::rotate_obc_segment_direction
mom_open_boundary::rotate_obc_segment_config → mom_open_boundary::rotate_obc_segment_direction
mom_open_boundary::write_obc_info → mom_open_boundary::rotate_obc_segment_direction
shelfwave_initialization::shelfwave_set_obc_data → mom_open_boundary::rotate_obc_segment_direction
supercritical_initialization::supercritical_set_obc_data → mom_open_boundary::rotate_obc_segment_direction
- function rotated_field_name(input_name, turns)
Return the that the field would have after being rotated by the given number of quarter turns
- Parameters
input_name [in]
The unrotated field name
turns [in]
Number of quarter turns of the grid
rotated_field_name
The rotated field name
Callers call graph
- subroutine allocate_rotated_seg_data(src_array, HI_in, tgt_array, segment)
Allocate an array of data for a field on a segment based on the size of a potentially rotated source array
- Parameters
src_array [in]
The segment data on the unrotated source grid
HI_in [in]
Horizontal indices on the source grid
tgt_array [inout]
The segment data that is being allocated
segment [inout]
OBC segment on the target grid
- subroutine write_OBC_info(OBC, G, GV, US)
Write out information about the contents of the OBC control structure
- Parameters
OBC
An open boundary condition control structure
G [in]
Rotated grid metric
GV [in]
Vertical grid
US [in]
Unit scaling
Callees call graph
- subroutine chksum_OBC_segments(OBC, G, GV, US, nk)
Write checksums and perhaps some or all of the values of all the allocated arrays on the OBC segments.
- Parameters
OBC [in]
An open boundary condition control structure
G [in]
Rotated grid metric
GV [in]
Vertical grid
US [in]
Unit scaling
nk [in]
The number of layers to print
Callees call graph
- subroutine chksum_OBC_segment_data(segment, GV, US, nk, nseg_out)
Write checksums and perhaps some or all of the values of all the allocated arrays on a single OBC segment.
- Parameters
segment [in]
Segment type to checksum
GV [in]
Vertical grid
US [in]
Unit scaling
nk [in]
The number of layers to print
nseg_out [in]
The segment number reported in output
Callees call graph
Callers call graph
- subroutine write_2d_array_vals(name, Array, seg_dir, nkp, unscale)
Write out the values in a named 2-d segment data array
- Parameters
name [in]
The name of the variable
Array [in]
The 2-d array to write [A ~> a]
seg_dir [in]
The direction of the segment
nkp [in]
Print all the values if this is greater than 0
unscale [in]
A factor that undoes the scaling of the array [a A-1 ~> 1]
Callees call graph
Callers call graph
- subroutine write_3d_array_vals(name, Array, seg_dir, nkp, unscale)
Write out the values in a 3-d segment data array
- Parameters
name [in]
The name of the variable
Array [in]
The 3-d array to write
seg_dir [in]
The direction of the segment
nkp [in]
The number of layers to print
unscale [in]
A factor that undoes the scaling of the array [a A-1 ~> 1]
Callees call graph
Callers call graph