mom_open_boundary module reference
Controls where open boundary conditions are applied.
Data Types
Open boundary segment data from files (mostly). |
|
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. |
|
Open-boundary data. |
|
Control structure for open boundaries that read from files. |
|
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. |
|
Setup vertical remapping for open boundaries. |
|
Determine which physical fields are required for this segment based on boundary-condition type and segment orientation. |
|
Find physical field index from name. |
|
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. |
|
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 OBCsegnum_u and OBCsegnum_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. |
|
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. |
|
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. |
|
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. |
|
Fill segmenth_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 OBC values on the segments from files. |
|
Update the OBC values on the segments. |
|
Initialize thickness and tracer reservoirs to external value. |
|
Update the OBC ramp value as a function of time. |
|
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 array that is active on an OBC segment, potentially also specifying how the tracer inflow values are specified. |
|
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. |
|
flood the cin, cout values |
|
flood the cin, cout values |
|
Register OBC segment data for restarts. |
|
Update the OBC tracer reservoirs after the tracers have been updated. |
|
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. |
|
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 mom_open_boundary/obc_segment_data_type
Open boundary segment data from files (mostly).
- Type fields:
% handle ::
type(external_field)handle from FMS associated with segment data on disk% dz_handle ::
type(external_field)handle from FMS associated with segment thicknesses on disk% required ::
logicalTrue if this field is required.% use_io ::
logicalTrue if segment data is based on file input.% name ::
character(len=32)A name identifier for the segment data. When there is grid rotation, this is the name on the rotated internal grid.% tr_index ::
integerIf this field is a tracer, its index in registry is stored here.% bgc_tracer ::
logicalTrue if this field is a BGC tracer.% on_face ::
logicalIf true, this field is discretized on the OBC segment (velocity-point) faces, or if false it as the vorticiy points.% scale ::
realA 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 ::
real, dimension(:,:,:), allocatablebuffer 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 ::
integerNumber of vertical levels in the source data.% dz_src ::
real, dimension(:,:,:), allocatablevertical grid cell spacing of the incoming segment data in [Z ~> m].% buffer_dst ::
real, dimension(:,:,:), allocatablebuffer 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 ::
realA 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 ::
realThe 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 ::
realThe 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 mom_open_boundary/obc_segment_tracer_type
Tracer on OBC segment data structure, for putting into a segment tracer registry.
- Type fields:
% t ::
real, dimension(:,:,:), allocatabletracer concentration array in rescaled units, like [S ~> ppt] for salinity.% obc_inflow_conc ::
realtracer concentration for generic inflows in rescaled units, like [S ~> ppt] for salinity.% name ::
character(len=32)tracer name used for error messages% tr ::
type(tracer_type), pointermetadata describing the tracer% tres ::
real, dimension(:,:,:), allocatabletracer reservoir array in rescaled units, like [S ~> ppt] for salinity.% scale ::
realA scaling factor for converting the units of input data, like [S ppt-1 ~> 1] for salinity.% is_initialized ::
logicalreservoir values have been set when True% ntr_index ::
integerindex of segment tracer in the global tracer registry% fd_index ::
integerindex of segment tracer in the input fields
- type mom_open_boundary/obc_segment_thickness_type
Thickness on OBC segment data structure, with a reservoir.
- Type fields:
% h ::
real, dimension(:,:,:), allocatablelayer thickness array in rescaled units, [Z ~> m].% obc_inflow_conc ::
reallayer thickness for generic inflows in rescaled units, [Z ~> m].% name ::
character(len=32)thickness name used for error messages% h_res ::
real, dimension(:,:,:), allocatablethickness reservoir array in rescaled units, [Z ~> m].% scale ::
realA scaling factor for converting the units of input data, [Z m-1 ~> 1].% is_initialized ::
logicalreservoir values have been set when True% fd_index ::
integerindex of segment thickness in the input fields
- type mom_open_boundary/segment_tracer_registry_type
Registry type for tracers on segments.
- Type fields:
% ntseg ::
integernumber of registered tracer segments% tr ::
type(obc_segment_tracer_type), dimension(50)array of registered tracers% locked ::
logicalNew 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 mom_open_boundary/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.
- Type fields:
% flather ::
logicalIf true, applies Flather + Chapman radiation of barotropic gravity waves.% radiation ::
logicalIf true, 1D Orlanksi radiation boundary conditions are applied. If False, a gradient condition is applied.% radiation_tan ::
logicalIf true, 1D Orlanksi radiation boundary conditions are applied to tangential flows.% radiation_grad ::
logicalIf true, 1D Orlanksi radiation boundary conditions are applied to dudv and dvdx.% oblique ::
logicalOblique waves supported at radiation boundary.% oblique_tan ::
logicalIf true, 2D radiation boundary conditions are applied to tangential flows.% oblique_grad ::
logicalIf true, 2D radiation boundary conditions are applied to dudv and dvdx.% nudged ::
logicalOptional supplement to radiation boundary.% nudged_tan ::
logicalOptional supplement to nudge tangential velocity.% nudged_grad ::
logicalOptional supplement to nudge normal gradient of tangential velocity.% specified ::
logicalBoundary normal velocity fixed to external value.% specified_tan ::
logicalBoundary tangential velocity fixed to external value.% specified_grad ::
logicalBoundary gradient of tangential velocity fixed to external value.% open ::
logicalBoundary is open for continuity solver, and there are no other parameterized mass fluxes at the open boundary.% gradient ::
logicalZero gradient at boundary.% direction ::
integerBoundary faces one of the four directions.% is_n_or_s ::
logicalTrue if the OB is facing North or South and exists on this PE.% is_e_or_w ::
logicalTrue if the OB is facing East or West and exists on this PE.% is_e_or_w_2 ::
logicalTrue if the OB is facing East or West anywhere.% field ::
type(obc_segment_data_type), dimension(:), pointerOBC data.% num_fields ::
integernumber of OBC data fields (e.g. u_normal,u_parallel and eta for Flather)% is_obc ::
integerStarting local i-index of boundary segment, this may be outside of the local PE.% ie_obc ::
integerEnding local i-index of boundary segment, this may be outside of the local PE.% js_obc ::
integerStarting local j-index of boundary segment, this may be outside of the local PE.% je_obc ::
integerEnding local j-index of boundary segment, this may be outside of the local PE.% velocity_nudging_timescale_in ::
realNudging timescale on inflow [T ~> s].% velocity_nudging_timescale_out ::
realNudging timescale on outflow [T ~> s].% on_pe ::
logicaltrue if any portion of the segment is located in this PE’s data domain% temp_segment_data_exists ::
logicaltrue if temperature data arrays are present% salt_segment_data_exists ::
logicaltrue if salinity data arrays are present% cg ::
real, dimension(:,:), allocatableThe external gravity wave speed [L T-1 ~> m s-1] at OBC-points.% htot ::
real, dimension(:,:), allocatableThe total column thickness [H ~> m or kg m-2] at OBC-points.% dztot ::
real, dimension(:,:), allocatableThe total column vertical extent [Z ~> m] at OBC segment faces.% h ::
real, dimension(:,:,:), allocatableThe cell thickness [H ~> m or kg m-2] at OBC segment faces.% normal_vel ::
real, dimension(:,:,:), allocatableThe layer velocity normal to the OB segment [L T-1 ~> m s-1].% tangential_vel ::
real, dimension(:,:,:), allocatableThe layer velocity tangential to the OB segment [L T-1 ~> m s-1], discretized at the corner points.% tangential_grad ::
real, dimension(:,:,:), allocatableThe gradient of the velocity tangential to the OB segment [T-1 ~> s-1], discretized at the corner points.% normal_trans ::
real, dimension(:,:,:), allocatableThe layer transport normal to the OB segment [H L2 T-1 ~> m3 s-1].% normal_vel_bt ::
real, dimension(:,:), allocatableThe barotropic velocity normal to the OB segment [L T-1 ~> m s-1].% normal_trans_bt ::
real, dimension(:,:), allocatableThe barotropic transport normal the OB segment [H L2 T-1 ~> m3 s-1 or kg s-1].% tidal_vn ::
real, dimension(:,:), allocatableThe barotropic tidal velocity normal to the OB segment [L T-1 ~> m s-1].% tidal_vt ::
real, dimension(:,:), allocatableThe barotropic tidal velocity tangential to the OB segment [L T-1 ~> m s-1].% ssh ::
real, dimension(:,:), allocatableThe sea-surface elevation along the segment [Z ~> m].% tidal_elev ::
real, dimension(:,:), allocatableTidal elevation at the OBC points [Z ~> m].% grad_normal ::
real, dimension(:,:,:), allocatableThe 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 ::
real, dimension(:,:,:), allocatableThe 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 ::
real, dimension(:,:,:), allocatableThe 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 ::
real, dimension(:,:,:), allocatableThe previous normal phase speed use for EW radiation OBC, in grid points per timestep [nondim].% ry_norm_rad ::
real, dimension(:,:,:), allocatableThe previous normal phase speed use for NS radiation OBC, in grid points per timestep [nondim].% rx_norm_obl ::
real, dimension(:,:,:), allocatableThe previous x-direction normalized radiation coefficient for either EW or NS oblique OBCs [L2 T-2 ~> m2 s-2].% ry_norm_obl ::
real, dimension(:,:,:), allocatableThe previous y-direction normalized radiation coefficient for either EW or NS oblique OBCs [L2 T-2 ~> m2 s-2].% cff_normal ::
real, dimension(:,:,:), allocatableThe denominator for oblique radiation of the normal velocity [L2 T-2 ~> m2 s-2].% nudged_normal_vel ::
real, dimension(:,:,:), allocatableThe layer velocity normal to the OB segment that values should be nudged towards [L T-1 ~> m s-1].% nudged_tangential_vel ::
real, dimension(:,:,:), allocatableThe 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 ::
real, dimension(:,:,:), allocatableThe layer dvdx or dudy towards which nudging can occur [T-1 ~> s-1].% h_reg ::
type(obc_segment_thickness_type), pointerA pointer to the thickness for the segment.% tr_reg ::
type(segment_tracer_registry_type), pointerA pointer to the tracer registry for the segment.% hi ::
type(hor_index_type)Horizontal index ranges.% tr_invlscale_out ::
realAn 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 ::
realAn 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 ::
realAn 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 ::
realAn effective inverse length scale for restoring the layer thickness towards an externally imposed value when flow is entering [L-1 ~> m-1].
- type mom_open_boundary/ocean_obc_type
Open-boundary data.
- Type fields:
% is_u_w_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% ie_u_w_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% js_u_w_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% je_u_w_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% is_u_e_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% ie_u_e_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% js_u_e_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% je_u_e_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% is_v_s_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% ie_v_s_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% js_v_s_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% je_v_s_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% is_v_n_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% ie_v_n_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% js_v_n_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% je_v_n_obc ::
integerIndex ranges on the local PE for the open boundary conditions in various directions.% number_of_segments ::
integerThe number of open-boundary segments.% reverse_segment_order ::
logicalIf true, store the segments internally in the reversed order.% ke ::
integerThe number of model layers.% open_u_bcs_exist_globally ::
logicalTrue if any zonal velocity points in the global domain use open BCs.% open_v_bcs_exist_globally ::
logicalTrue if any meridional velocity points in the global domain use open BCs.% flather_u_bcs_exist_globally ::
logicalTrue if any zonal velocity points in the global domain use Flather BCs.% flather_v_bcs_exist_globally ::
logicalTrue if any meridional velocity points in the global domain use Flather BCs.% oblique_bcs_exist_globally ::
logicalTrue if any velocity points in the global domain use oblique BCs.% nudged_u_bcs_exist_globally ::
logicalTrue if any velocity points in the global domain use nudged BCs.% nudged_v_bcs_exist_globally ::
logicalTrue if any velocity points in the global domain use nudged BCs.% specified_u_bcs_exist_globally ::
logicalTrue if any zonal velocity points in the global domain use specified BCs.% specified_v_bcs_exist_globally ::
logicalTrue if any meridional velocity points in the global domain use specified BCs.% radiation_bcs_exist_globally ::
logicalTrue if radiations BCs are in use anywhere.% user_bcs_set_globally ::
logicalTrue if any OBC_USER_CONFIG is set for input from user directory.% update_obc ::
logicalIs OBC data time-dependent.% update_obc_seg_data ::
logicalIs it the time for OBC segment data update for fields that require less frequent update.% needs_io_for_data ::
logicalIs any i/o needed for OBCs on the current PE.% any_needs_io_for_data ::
logicalIs any i/o needed for OBCs globally.% vorticity_config ::
integerAn integer indicating OBC relative vorticity configuration.% strain_config ::
integerAn integer indicating OBC strain configuration.% zero_biharmonic ::
logicalIf True, zeros the Laplacian of flow on open boundaries for use in the biharmonic viscosity term.% brushcutter_mode ::
logicalIf True, read data on supergrid.% tracer_x_reservoirs_used ::
logical, dimension(:), allocatableDimensioned by the number of tracers, set globally, true for those with x reservoirs (needed for restarts).% tracer_y_reservoirs_used ::
logical, dimension(:), allocatableDimensioned by the number of tracers, set globally, true for those with y reservoirs (needed for restarts).% thickness_x_reservoirs_used ::
logicalTrue for thichness reservoirs in x (needed for restarts).% thickness_y_reservoirs_used ::
logicalTrue for thichness reservoirs in y (needed for restarts).% ntr ::
integernumber of tracers% n_tide_constituents ::
integerNumber of tidal constituents to add to the boundary.% add_tide_constituents ::
logicalIf true, add tidal constituents to the boundary elevation and velocity. Will be set to true if n_tide_constituents > 0.% tide_names ::
character(len=2), dimension(:), allocatableNames of tidal constituents to add to the boundary data.% tide_frequencies ::
real, dimension(:), allocatableAngular frequencies of chosen tidal constituents [rad T-1 ~> rad s-1].% tide_eq_phases ::
real, dimension(:), allocatableEquilibrium phases of chosen tidal constituents [rad].% tide_fn ::
real, dimension(:), allocatableAmplitude modulation of boundary tides by nodal cycle [nondim].% tide_un ::
real, dimension(:), allocatablePhase modulation of boundary tides by nodal cycle [rad].% add_eq_phase ::
logicalIf true, add the equilibrium phase argument to the specified boundary tidal phase.% add_nodal_terms ::
logicalIf true, insert terms for the 18.6 year modulation when calculating tidal boundary conditions.% time_ref ::
type(time_type)Reference date (t = 0) for tidal forcing.% tidal_longitudes ::
type(astro_longitudes)Lunar and solar longitudes used to calculate tidal forcing.% segment ::
type(obc_segment_type), dimension(:), allocatableList of segment objects.% segnum_u ::
integer, dimension(:,:), allocatableThe 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 ::
integer, dimension(:,:), allocatableThe 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 ::
type(external_tracers_segments_props), pointerobgc segment properties% num_obgc_tracers ::
integerThe total number of obgc tracers.% gamma_uv ::
realThe 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 ::
realThe maximum magnitude of the baroclinic radiation velocity (or speed of characteristics) in units of grid points per timestep [nondim].% obc_pe ::
logicalIs there an open boundary on this tile?% u_obcs_on_pe ::
logicalTrue if there are any u-point OBCs on this PE, including in its halos.% v_obcs_on_pe ::
logicalTrue if there are any v-point OBCs on this PE, including in its halos.% v_n_obcs_on_pe ::
logicalTrue if there are any northern v-point OBCs on this PE, including in its halos.% v_s_obcs_on_pe ::
logicalTrue if there are any southern v-point OBCs on this PE, including in its halos.% u_e_obcs_on_pe ::
logicalTrue if there are any eastern u-point OBCs on this PE, including in its halos.% u_w_obcs_on_pe ::
logicalTrue if there are any western u-point OBCs on this PE, including in its halos.% remap_z_cs ::
type(remapping_cs), pointerALE remapping control structure for z-space data on segments.% remap_h_cs ::
type(remapping_cs), pointerALE remapping control structure for thickness-based fields on segments.% obc_reg ::
type(obc_registry_type), pointerRegistry type for boundaries.% rx_normal ::
real, dimension(:,:,:), allocatableArray storage for normal phase speed for EW radiation OBCs in units of grid points per timestep [nondim].% ry_normal ::
real, dimension(:,:,:), allocatableArray storage for normal phase speed for NS radiation OBCs in units of grid points per timestep [nondim].% rx_oblique_u ::
real, dimension(:,:,:), allocatableX-direction oblique boundary condition radiation speeds squared at u points for restarts [L2 T-2 ~> m2 s-2].% ry_oblique_u ::
real, dimension(:,:,:), allocatableY-direction oblique boundary condition radiation speeds squared at u points for restarts [L2 T-2 ~> m2 s-2].% rx_oblique_v ::
real, dimension(:,:,:), allocatableX-direction oblique boundary condition radiation speeds squared at v points for restarts [L2 T-2 ~> m2 s-2].% ry_oblique_v ::
real, dimension(:,:,:), allocatableY-direction oblique boundary condition radiation speeds squared at v points for restarts [L2 T-2 ~> m2 s-2].% cff_normal_u ::
real, dimension(:,:,:), allocatableDenominator for normalizing EW oblique boundary condition radiation rates at u points for restarts [L2 T-2 ~> m2 s-2].% cff_normal_v ::
real, dimension(:,:,:), allocatableDenominator for normalizing NS oblique boundary condition radiation rates at v points for restarts [L2 T-2 ~> m2 s-2].% tres_x ::
real, dimension(:,:,:,:), allocatableArray storage of tracer reservoirs for restarts, in unscaled units [conc].% tres_y ::
real, dimension(:,:,:,:), allocatableArray storage of tracer reservoirs for restarts, in unscaled units [conc].% h_res_x ::
real, dimension(:,:,:), allocatableArray storage of thickness reservoirs for restarts, [Z ~> m].% h_res_y ::
real, dimension(:,:,:), allocatableArray storage of thickness reservoirs for restarts, [Z ~> m].% use_h_res ::
logicalIf true, use thickness reservoirs.% debug ::
logicalIf true, write verbose checksums for debugging purposes.% nk_obc_debug ::
integerThe number of layers of OBC segment data to write out in full when DEBUG_OBCS is true.% silly_h ::
realA 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 ::
realA 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 ::
logicalIf True, ramp from zero to the external values for SSH.% ramping_is_activated ::
logicalTrue if the ramping has been initialized.% ramp_timescale ::
realIf ramp is True, use this timescale for ramping [T ~> s].% trunc_ramp_time ::
realIf ramp is True, time after which ramp is done [T ~> s].% ramp_value ::
realIf ramp is True, where we are on the ramp from zero to one [nondim].% ramp_start_time ::
type(time_type)Time when model was started.% remap_answer_date ::
integerThe 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 ::
logicalFlag for remapping to run checks on reconstruction.% check_remapping ::
logicalFlag for remapping to run internal checks.% force_bounds_in_subcell ::
logicalFlag for remapping to hide overshoot using bounds.% om4_remap_via_sub_cells ::
logicalIf true, use the OM4 remapping algorithm.% remappingscheme ::
character(40)String selecting the vertical remapping scheme.% pass_oblique ::
type(group_pass_type)Structure for group halo pass.% exterior_obc_bug ::
logicalIf true, use incorrect form of tracers exterior to OBCs.% hor_index_bug ::
logicalIf true, recover set of a horizontal indexing bugs in the OBC code.% reservoir_init_bug ::
logicalIf 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 ::
logicalIf true, recover a bug that temperature and salinity can be ignored even if they are registered tracers in the rest of the model.
- type mom_open_boundary/file_obc_cs
Control structure for open boundaries that read from files. Probably lots to update here.
- Type fields:
% obc_file_used ::
logicalPlaceholder for now to avoid an empty type.
- type mom_open_boundary/obc_struct_type
Type to carry something (what??) for the OBC registry.
- Type fields:
% name ::
character(len=32)OBC name used for error messages.
- type mom_open_boundary/obc_registry_type
Type to carry basic OBC information needed for updating values.
- Type fields:
% nobc ::
integernumber of registered open boundary types.% ob ::
type(obc_struct_type), dimension(max_fields_)array of registered boundary types.% locked ::
logicalNew OBC types may be registered if locked=.false. When locked=.true.,no more boundaries can be registered.
- type mom_open_boundary/external_tracers_segments_props
Type to carry OBC information needed for setting segments for OBGC tracers.
- Type fields:
% next ::
type(external_tracers_segments_props), pointer, privatepointer to the next node% tracer_name ::
character(len=128), privatetracer name% tracer_src_file ::
character(len=128), privatetracer source file for BC% tracer_src_field ::
character(len=128), privatename of the field in source file to extract BC% lfac_in ::
real, privatemultiplicative factor for inbound tracer reservoir length scale [nondim]% lfac_out ::
real, privatemultiplicative factor for outbound tracer reservoir length scale [nondim]
Function/Subroutine Documentation
- subroutine mom_open_boundary/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 ::
param_file[in] Parameter file handleobc :: Open boundary control structure
- Call to:
initialize_obc_tidesmask_outside_obcsmdlmom_error_handler::mom_errorobc_noneobc_strain_computedobc_strain_freeslipobc_strain_noneobc_strain_specifiedobc_strain_zeroobc_vorticity_computedobc_vorticity_freeslipobc_vorticity_noneobc_vorticity_specifiedobc_vorticity_zeroopen_boundary_deallocopen_boundary_querymom_string_functions::remove_spacesset_segnum_signssetup_u_point_obcsetup_v_point_obc
- subroutine mom_open_boundary/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
- Call to:
- subroutine mom_open_boundary/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. This subroutine could turn into a TBP for OBC_segment_type.
- Parameters:
segment ::
segment[inout] OBC segmenttides ::
tides[in] Switch for tidal variablestemp_salt ::
temp_salt[in] Switch for thermodynamic variables
- Call to:
f_sf_tf_uf_uphasef_uyf_vf_vampf_vphasef_vxf_zf_zampf_zphasemom_error_handler::mom_error- Called from:
- function mom_open_boundary/find_phys_field_index(name)
Find physical field index from name.
- Parameters:
name ::
name[in] Field name- Call to:
num_phys_fieldsphys_field_names- Called from:
- subroutine mom_open_boundary/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 ::
field[inout] A field of the segmentobc :: [in] Open boundary control structure
segment ::
segment[inout] Segment to work onus :: [in] A dimensional unit scaling type
inputdir ::
inputdir[in] The directory of input filesfilename ::
filename[in] Input file namevarname ::
varname[in] Variable name in the input filesuffix ::
suffix[in] Variable name suffix, “_segment_xxx”value ::
value[in] Unscaled specified value of the field [a]turns ::
turns[in] Number of quarter turns of the gridnz ::
nz[in] Default k-axis size in buffer_dst
- Call to:
field_is_on_facefield_is_tidalmom_error_handler::mom_errorscale_factor_from_name- Called from:
- subroutine mom_open_boundary/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 ::
turns[in] Number of quarter turns of the griduse_temperature ::
use_temperature[in] If true, temperature and salinity used as state variables.
- Call to:
allocate_segment_field_datachksum_obc_segment_dataf_sf_tfind_phys_field_indexget_obgc_segments_propsget_tracer_indexmdlmom_error_handler::mom_errornum_phys_fieldsparse_segment_data_strparse_segment_manifest_strphys_field_namesrotated_field_namesegment_determine_required_fields
- function mom_open_boundary/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 ::
name[in] The OBC segment data name to interpretis_e_or_w :: [in] This is true for an eastern or western open boundary condition
- Called from:
- function mom_open_boundary/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 ::
name[in] The OBC segment data name to interpret- Called from:
- subroutine mom_open_boundary/set_segnum_signs(OBC, G)
This subroutine sets the sign of the OBCsegnum_u and OBCsegnum_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
- Call to:
obc_direction_sobc_direction_w- Called from:
- function mom_open_boundary/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 ::
name[in] The OBC segment data name to interpretus :: [in] A dimensional unit scaling type
tr_reg :: pointer to tracer registry for this segment
- Call to:
- Called from:
- subroutine mom_open_boundary/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 ::
param_file[in] Parameter file handle
- Call to:
mom_tidal_forcing::astro_longitudes_initmom_tidal_forcing::eq_phasemdlmom_error_handler::mom_mesgmom_tidal_forcing::nodal_fumom_tidal_forcing::tidal_frequency- Called from:
- subroutine mom_open_boundary/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 ::
seg[inout] Open boundary segmentis_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
- Called from:
rotate_obc_segment_configsetup_u_point_obcsetup_v_point_obc
- subroutine mom_open_boundary/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 ::
segment_str[in] A string in form of “I=%,J=%:%,string”l_seg ::
l_seg[in] The internal segment numberl_seg_io ::
l_seg_io[in] The segment number used for reading parameterspf :: [in] Parameter file handle
reentrant_y ::
reentrant_y[in] is the domain reentrant in y?
- Call to:
allocate_obc_segment_datamdlmom_error_handler::mom_errorobc_direction_eobc_direction_wparse_segment_strsetup_segment_indices- Called from:
- subroutine mom_open_boundary/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 ::
segment_str[in] A string in form of “J=%,I=%:%,string”l_seg ::
l_seg[in] The internal segment numberl_seg_io ::
l_seg_io[in] The segment number used for reading parameterspf :: [in] Parameter file handle
reentrant_x ::
reentrant_x[in] is the domain reentrant in x?
- Call to:
allocate_obc_segment_datamdlmom_error_handler::mom_errorobc_direction_nobc_direction_sparse_segment_strsetup_segment_indices- Called from:
- subroutine mom_open_boundary/parse_segment_str(ni_global, nj_global, segment_str, l, m, n, action_str, reentrant)
Parse an OBC_SEGMENT_%%% string.
- Parameters:
ni_global ::
ni_global[in] Number of h-points in zonal directionnj_global ::
nj_global[in] Number of h-points in meridional directionsegment_str ::
segment_str[in] A string in form of “I=l,J=m:n,string” or “J=l,I=m,n,string”l ::
l[out] The value of I=l, if segment_str begins with I=l, or the value of J=lm ::
m[out] The value of J=m, if segment_str begins with I=, or the value of I=mn ::
n[out] The value of J=n, if segment_str begins with I=, or the value of I=naction_str ::
action_str[out] The “string” part of segment_strreentrant ::
reentrant[in] is domain reentrant in relevant direction?
- Call to:
mom_string_functions::extract_wordinterpret_int_exprmom_error_handler::mom_error- Called from:
- subroutine mom_open_boundary/parse_segment_manifest_str(segment_str, num_fields, fields)
Parse an OBC_SEGMENT_%%_DATA string and determine its fields.
- Parameters:
segment_str ::
segment_str[in] A string in form of “VAR1=file:foo1.nc(varnam1),VAR2=file:foo2.nc(varnam2),…”num_fields ::
num_fields[out] The number of fields in the segment datafields ::
fields[out] List of fieldnames for each segment
- Call to:
mom_string_functions::extract_wordmom_error_handler::mom_errornum_phys_fields- Called from:
- subroutine mom_open_boundary/parse_segment_data_str(segment_str, idx, var, value, filename, fieldname)
Parse an OBC_SEGMENT_%%_DATA string.
- Parameters:
segment_str ::
segment_str[in] A string in form of “VAR1=file:foo1.nc(varnam1),VAR2=file:foo2.nc(varnam2),…”idx ::
idx[in] Index of segment_str recordvar ::
var[in] The name of the variable for which parameters are neededfilename ::
filename[out] The name of the input file if using “file” methodfieldname ::
fieldname[out] The name of the variable in the input file if using “file” methodvalue ::
value[out] A constant value if using the “value” method in various units but without the internal rescaling [various units]
- Call to:
mom_string_functions::extract_wordmom_error_handler::mom_error- Called from:
- subroutine mom_open_boundary/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 ::
use_temperature[in] If true, T and S are used
- Call to:
- Called from:
- subroutine mom_open_boundary/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
- Call to:
id_clock_pass
- function mom_open_boundary/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 ::
needs_ext_seg_data[in] Returns True if external segment data needed
- Called from:
- subroutine mom_open_boundary/open_boundary_dealloc(OBC)
Deallocate open boundary data.
- Parameters:
obc :: Open boundary control structure
- Call to:
- Called from:
- subroutine mom_open_boundary/open_boundary_end(OBC)
Close open boundary data.
- Parameters:
obc :: Open boundary control structure
- Call to:
- subroutine mom_open_boundary/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 ::
depth[inout] Bathymetry at h-points, in [Z ~> m] or other units
- Call to:
obc_direction_eobc_direction_nobc_direction_sobc_direction_w
- subroutine mom_open_boundary/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]
- Call to:
obc_direction_eobc_direction_sobc_direction_w- Called from:
- subroutine mom_open_boundary/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
- subroutine mom_open_boundary/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
- subroutine mom_open_boundary/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
- Called from:
- subroutine mom_open_boundary/copy_thickness_reservoirs(OBC, G, GV)
Fill segmenth_Reg from restart fields.
- Parameters:
g :: [inout] Ocean grid structure
gv :: [in] The ocean’s vertical grid structure
obc :: Open boundary control structure
- subroutine mom_open_boundary/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 ::
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 ::
u_old[in] Original unadjusted u [L T-1 ~> m s-1]v_new ::
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 ::
v_old[in] Original unadjusted v [L T-1 ~> m s-1]us :: [in] A dimensional unit scaling type
dt ::
dt[in] Appropriate timestep [T ~> s]
- Call to:
chksum_obc_segmentsgradient_at_q_pointsid_clock_passobc_direction_eobc_direction_nobc_direction_sobc_direction_wopen_boundary_apply_normal_flow
- subroutine mom_open_boundary/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 ::
u[inout] u field to update on open boundaries [L T-1 ~> m s-1]v ::
v[inout] v field to update on open boundaries [L T-1 ~> m s-1]
- Called from:
- subroutine mom_open_boundary/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 ::
u[inout] u field to update on open boundaries [arbitrary]v ::
v[inout] v field to update on open boundaries [arbitrary]
- Called from:
mom_dynamics_unsplit::step_mom_dyn_unsplitmom_dynamics_unsplit_rk2::step_mom_dyn_unsplit_rk2
- subroutine mom_open_boundary/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 ::
segment[inout] OBC segment structureuvel ::
uvel[in] zonal velocity [L T-1 ~> m s-1]vvel ::
vvel[in] meridional velocity [L T-1 ~> m s-1]
- Call to:
obc_direction_eobc_direction_n- Called from:
- function mom_open_boundary/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 ::
field[in] The field name
- function mom_open_boundary/get_tracer_index(OBC_seg, tr_name)
Return the tracer index from its name.
- Parameters:
obc_seg :: OBC segment
tr_name ::
tr_name[in] The field name
- Called from:
- subroutine mom_open_boundary/allocate_obc_segment_data(OBC, segment)
Allocate segment data fields.
- Parameters:
obc :: [in] Open boundary structure
segment ::
segment[inout] Open boundary segment
- Call to:
obc_strain_computedobc_strain_specifiedobc_vorticity_computedobc_vorticity_specified- Called from:
- subroutine mom_open_boundary/deallocate_obc_segment_data(segment)
Deallocate segment data fields.
- Parameters:
segment ::
segment[inout] Open boundary segment- Call to:
- Called from:
- subroutine mom_open_boundary/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 ::
u[inout] Zonal velocity [L T-1 ~> m s-1]v ::
v[inout] Meridional velocity [L T-1 ~> m s-1]
- Call to:
obc_direction_eobc_direction_n
- subroutine mom_open_boundary/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 ::
h[inout] Layer thickness [H ~> m or kg m-2]
- Call to:
obc_direction_eobc_direction_n
- subroutine mom_open_boundary/read_obc_segment_data(G, GV, US, OBC, tv, h, Time)
Read OBC values on the segments from files.
- Parameters:
g :: [in] Ocean grid structure
gv :: [in] Ocean vertical grid structure
us :: [in] A dimensional unit scaling type
obc :: Open boundary structure
tv ::
tv[in] Thermodynamics structureh ::
h[in] Thickness [H ~> m or kg m-2]time :: [in] Model time
- Call to:
- subroutine mom_open_boundary/update_obc_segment_data(G, GV, US, OBC, h, Time)
Update the OBC values on the segments.
- Parameters:
g :: [in] Ocean grid structure
gv :: [in] Ocean vertical grid structure
us :: [in] A dimensional unit scaling type
obc :: Open boundary structure
h ::
h[in] Thickness [H ~> m or kg m-2]time :: [in] Model time
- Call to:
f_uf_uampf_uphasef_uyf_vf_vampf_vphasef_vxf_zf_zampf_zphasenum_phys_fields
- subroutine mom_open_boundary/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
- Call to:
num_phys_fields
- subroutine mom_open_boundary/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 ::
activate[in] Specify whether to record the value of Time as the beginning of the ramp period
- subroutine mom_open_boundary/register_obc(name, param_file, Reg)
register open boundary objects for boundary updates.
- Parameters:
name ::
name[in] OBC name used for error messagesparam_file ::
param_file[in] file to parse for model parameter valuesreg :: pointer to the tracer registry
- Call to:
- Called from:
dyed_channel_initialization::register_dyed_channel_obcregister_file_obc
- subroutine mom_open_boundary/obc_registry_init(param_file, Reg)
This routine include declares and sets the variable “version”.
- Parameters:
param_file ::
param_file[in] open file to parse for model parametersreg :: pointer to OBC registry
- Called from:
- function mom_open_boundary/register_file_obc(param_file, CS, US, OBC_Reg)
Add file to OBC registry.
- Parameters:
param_file ::
param_file[in] parameter file.cs :: file control structure.
us :: [in] A dimensional unit scaling type
obc_reg :: OBC registry.
- Call to:
- Called from:
- subroutine mom_open_boundary/file_obc_end(CS)
Clean up the file OBC from registry.
- Parameters:
cs :: OBC file control structure.
- Called from:
- subroutine mom_open_boundary/segment_tracer_registry_init(param_file, segment)
Initialize the segment tracer registry.
- Parameters:
param_file ::
param_file[in] open file to parse for model parameterssegment ::
segment[inout] the segment
- Call to:
mdl- Called from:
- subroutine mom_open_boundary/segment_thickness_reservoir_init(GV, US, OBC, param_file)
Initialize all the segment thickness reservoirs.
- Parameters:
param_file ::
param_file[in] open file to parse for model parametersgv :: [in] ocean vertical grid structure
us :: [in] Unit scaling type
obc :: Open boundary structure
- Call to:
mdl- Called from:
- subroutine mom_open_boundary/register_segment_tracer(tr_ptr, ntr_index, param_file, GV, segment, OBC_scalar, OBC_array, scale, fd_index)
Register a tracer array that is active on an OBC segment, potentially also specifying how the tracer inflow values are specified.
- Parameters:
gv :: [in] ocean vertical grid structure
tr_ptr ::
tr_ptrA target that can be used to set a pointer to the stored value of tr. This target must be an enduring part of the control structure, because the tracer registry will use this memory, but it also means that any updates to this structure in the calling module will be available subsequently to the tracer registry.ntr_index ::
ntr_index[in] index of segment tracer in the global tracer registryparam_file ::
param_file[in] file to parse for model parameter valuessegment ::
segment[inout] current segment data structureobc_scalar :: [in] If present, use scalar value for segment tracer inflow concentration, including any rescaling to put the tracer concentration into its internal units, like [S ~> ppt] for salinity.
obc_array :: [in] If true, use array values for segment tracer inflow concentration.
scale ::
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.fd_index ::
fd_index[in] index of segment tracer in the input field
- Call to:
- Called from:
dome_initialization::dome_set_obc_datadyed_obcs_initialization::dyed_obcs_set_obc_dataregister_obgc_segmentsregister_temp_salt_segments
- subroutine mom_open_boundary/segment_tracer_registry_end(Reg)
Clean up the segment tracer registry.
- Parameters:
reg :: pointer to tracer registry
- Called from:
- subroutine mom_open_boundary/segment_thickness_registry_end(Reg)
Clean up the segment thickness object.
- Parameters:
reg :: pointer to thickness reservoir
- Called from:
- subroutine mom_open_boundary/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 ::
param_file[in] file to parse for model parameter values
- Call to:
- subroutine mom_open_boundary/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 ::
tr_name[in] Tracer nameobc_src_file_name ::
obc_src_file_name[in] OBC source file nameobc_src_field_name ::
obc_src_field_name[in] name of the field in the source filelfac_in ::
lfac_in[in] factors for tracer reservoir inbound length scales [nondim]lfac_out ::
lfac_out[in] factors for tracer reservoir outbound length scales [nondim]
- subroutine mom_open_boundary/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 ::
nodepointer to tracer segment propertiestr_name ::
tr_name[out] Tracer nameobc_src_file_name ::
obc_src_file_name[out] OBC source file nameobc_src_field_name ::
obc_src_field_name[out] name of the field in the source filelfac_in ::
lfac_in[out] multiplicative factor for inbound reservoir length scale [nondim]lfac_out ::
lfac_out[out] multiplicative factor for outbound reservoir length scale [nondim]
- Called from:
- subroutine mom_open_boundary/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 ::
param_file[in] file to parse for model parameter valuestr_name ::
tr_name[in] Tracer name
- Call to:
- subroutine mom_open_boundary/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 ::
tr_ptrPointer to tracer field in scaled concentration units, like [S ~> ppt] for salinity.tr_name ::
tr_name[in] Tracer name
- Call to:
get_tracer_indexobc_direction_eobc_direction_nobc_direction_sobc_direction_w
- subroutine mom_open_boundary/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 ::
tv[in] Thermodynamics structure
- Call to:
obc_direction_sobc_direction_w
- subroutine mom_open_boundary/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 ::
h[in] Layer thicknesses [H ~> m or kg m-2]
- Call to:
obc_direction_sobc_direction_w
- subroutine mom_open_boundary/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 ::
param_file[in] Parameter file handleobc :: Open boundary structure
us :: [in] A dimensional unit scaling type
- Call to:
- Called from:
- subroutine mom_open_boundary/flood_fill(G, color, cin, cout, cland)
flood the cin, cout values
- Parameters:
g :: [inout] Ocean grid structure
color ::
color[inout] For sorting inside from outside [nondim]cin ::
cin[in] color for inside the domaincout ::
cout[in] color for outside the domaincland ::
cland[in] color for inside the land mask
- Called from:
- subroutine mom_open_boundary/flood_fill2(G, color, cin, cout, cland)
flood the cin, cout values
- Parameters:
g :: [inout] Ocean grid structure
color ::
color[inout] For sorting inside from outside [nondim]cin ::
cin[in] color for inside the domaincout ::
cout[in] color for outside the domaincland ::
cland[in] color for inside the land mask
- Called from:
- subroutine mom_open_boundary/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 ::
param_file[in] Parameter file handlerestart_cs :: [inout] MOM restart control structure
use_temperature ::
use_temperature[in] If true, T and S are used
- Call to:
- subroutine mom_open_boundary/update_segment_tracer_reservoirs(G, GV, uhr, vhr, h, OBC, Reg)
Update the OBC tracer reservoirs after the tracers have been updated.
- Parameters:
g :: [in] The ocean’s grid structure
gv :: [in] Ocean vertical grid structure
uhr ::
uhr[in] accumulated volume/mass flux through the zonal face [H L2 ~> m3 or kg]vhr ::
vhr[in] accumulated volume/mass flux through the meridional face [H L2 ~> m3 or kg]h ::
h[in] layer thickness after advection [H ~> m or kg m-2]obc :: Open boundary structure
reg :: pointer to tracer registry
- Call to:
obc_direction_sobc_direction_w
- subroutine mom_open_boundary/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 ::
uhr[in] accumulated volume/mass flux through the zonal face [H L2 ~> m3 or kg]vhr ::
vhr[in] accumulated volume/mass flux through the meridional face [H L2 ~> m3 or kg]h ::
h[in] layer thickness after advection [H ~> m or kg m-2]obc :: Open boundary structure
- Call to:
obc_direction_sobc_direction_w- Called from:
mom_dynamics_split_rk2::step_mom_dyn_split_rk2mom_dynamics_split_rk2b::step_mom_dyn_split_rk2b
- subroutine mom_open_boundary/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 ::
h_old[in] Thickness of source grid [H ~> m or kg m-2]h_new ::
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
- Call to:
obc_direction_sobc_direction_w
- subroutine mom_open_boundary/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 GVAngstrom_Z. If the bottom most interface is above the topography then the entire column is dilated (expanded) to fill the void.
- Parameters:
g :: [in] The ocean’s grid structure
gv :: [in] The ocean’s vertical grid structure
us :: [in] A dimensional unit scaling type
segment ::
segment[inout] OBC segmentfld ::
fld[in] field index to adjust thicknessat_node ::
at_node[in] True this point is at the OBC nodes rather than the faces
- Called from:
- subroutine mom_open_boundary/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 ::
turns[in] Number of quarter turns
- Call to:
allocate_obc_segment_datarotate_obc_segment_configset_segnum_signs
- subroutine mom_open_boundary/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 ::
segment_in[in] Input OBC segmentg_in :: [in] Input grid metric
segment ::
segment[inout] Rotated OBC segmentg :: [in] Rotated grid metric
turns ::
turns[in] Number of quarter turns
- Call to:
obc_direction_eobc_direction_nobc_direction_sobc_direction_wrotate_obc_segment_directionsetup_segment_indices- Called from:
- function mom_open_boundary/rotate_obc_segment_direction(direction, turns)
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 ::
direction[in] The orientation of an OBC segment on the original gridturns ::
turns[in] Number of quarter turns
- Return:
undefined :: An integer encoding the new rotated segment direction
- Call to:
obc_direction_eobc_direction_nobc_direction_sobc_direction_wobc_none- Called from:
rotate_obc_segment_configshelfwave_initialization::shelfwave_set_obc_datawrite_obc_info
- function mom_open_boundary/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 ::
input_name[in] The unrotated field nameturns ::
turns[in] Number of quarter turns of the grid
- Return:
undefined :: The rotated field name
- Called from:
- subroutine mom_open_boundary/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 ::
src_array[in] The segment data on the unrotated source gridhi_in :: [in] Horizontal indices on the source grid
tgt_array ::
tgt_array[inout] The segment data that is being allocatedsegment ::
segment[inout] OBC segment on the target grid
- subroutine mom_open_boundary/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
- Call to:
chksum_obc_segmentsobc_direction_eobc_direction_nobc_direction_sobc_direction_wrotate_obc_segment_direction
- subroutine mom_open_boundary/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 ::
nk[in] The number of layers to print
- Call to:
- Called from:
- subroutine mom_open_boundary/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 ::
segment[in] Segment type to checksumgv :: [in] Vertical grid
us :: [in] Unit scaling
nk ::
nk[in] The number of layers to printnseg_out ::
nseg_out[in] The segment number reported in output
- Call to:
obc_direction_eobc_direction_nobc_direction_sobc_direction_wwrite_2d_array_valswrite_3d_array_vals- Called from: