mom_open_boundary module reference

Controls where open boundary conditions are applied.

More…

Data Types

obc_segment_data_type

Open boundary segment data from files (mostly).

obc_segment_tracer_type

Tracer on OBC segment data structure, for putting into a segment tracer registry.

segment_tracer_registry_type

Registry type for tracers on segments.

obc_segment_type

Open boundary segment data structure.

ocean_obc_type

Open-boundary data.

file_obc_cs

Control structure for open boundaries that read from files.

obc_struct_type

Type to carry something (what??) for the OBC registry.

obc_registry_type

Type to carry basic OBC information needed for updating values.

external_tracers_segments_props

Type to carry OBC information needed for setting segments for OBGC tracers.

Functions/Subroutines

open_boundary_config()

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.

initialize_segment_data()

Allocate space for reading OBC data from files.

scale_factor_from_name()

Return an appropriate dimensional scaling factor for input data based on an OBC segment data name, or 1 for tracers or other fields that do not match one of the specified names.

initialize_obc_tides()

Initize parameters and fields related to the specification of tides at open boundaries.

setup_segment_indices()

Define indices for segment and store in hor_index_type using global segment bounds corresponding to q-points.

setup_u_point_obc()

Parse an OBC_SEGMENT_%%% string starting with “I=” and configure placement and type of OBC accordingly.

setup_v_point_obc()

Parse an OBC_SEGMENT_%%% string starting with “J=” and configure placement and type of OBC accordingly.

parse_segment_str()

Parse an OBC_SEGMENT_%%% string.

parse_segment_manifest_str()

Parse an OBC_SEGMENT_%%_DATA string and determine its fields.

parse_segment_data_str()

Parse an OBC_SEGMENT_%%_DATA string.

parse_for_tracer_reservoirs()

Parse all the OBC_SEGMENT_%%_DATA strings again to see which need tracer reservoirs (all pes need to know).

open_boundary_init()

Initialize open boundary control structure and do any necessary rescaling of OBC fields that have been read from a restart file.

open_boundary_query()

open_boundary_dealloc()

Deallocate open boundary data.

open_boundary_end()

Close open boundary data.

open_boundary_impose_normal_slope()

Sets the slope of bathymetry normal to an open boundary to zero.

open_boundary_impose_land_mask()

Reconcile masks and open boundaries, deallocate OBC on PEs where it is not needed.

setup_obc_tracer_reservoirs()

Make sure the OBC tracer reservoirs are initialized.

radiation_open_bdry_conds()

Apply radiation conditions to 3D u,v at open boundaries.

open_boundary_apply_normal_flow()

Applies OBC values stored in segments to 3d u,v fields.

open_boundary_zero_normal_flow()

Applies zero values to 3d u,v fields on OBC segments.

gradient_at_q_points()

Calculate the tangential gradient of the normal flow at the boundary q-points.

set_tracer_data()

Sets the initial values of the tracer open boundary conditions.

lookup_seg_field()

Needs documentation.

get_tracer_index()

Return the tracer index from its name.

allocate_obc_segment_data()

Allocate segment data fields.

deallocate_obc_segment_data()

Deallocate segment data fields.

open_boundary_test_extern_uv()

Set tangential velocities outside of open boundaries to silly values (used for checking the interior state is independent of values outside of the domain).

open_boundary_test_extern_h()

Set thicknesses outside of open boundaries to silly values (used for checking the interior state is independent of values outside of the domain).

update_obc_segment_data()

Update the OBC values on the segments.

update_obc_ramp()

Update the OBC ramp value as a function of time.

register_obc()

register open boundary objects for boundary updates.

obc_registry_init()

This routine include declares and sets the variable “version”.

register_file_obc()

Add file to OBC registry.

file_obc_end()

Clean up the file OBC from registry.

segment_tracer_registry_init()

Initialize the segment tracer registry.

register_segment_tracer()

Register a tracer array that is active on an OBC segment, potentially also specifying how the tracer inflow values are specified.

segment_tracer_registry_end()

Clean up the segment tracer registry.

register_temp_salt_segments()

set_obgc_segments_props()

Sets the OBC properties of external obgc tracers, such as their source file and field name.

get_obgc_segments_props()

Get the OBC properties of external obgc tracers, such as their source file, field name, reservoir length scale factors.

register_obgc_segments()

fill_obgc_segments()

fill_temp_salt_segments()

mask_outside_obcs()

Find the region outside of all open boundary segments and make sure it is set to land mask.

flood_fill()

flood the cin, cout values

flood_fill2()

flood the cin, cout values

open_boundary_register_restarts()

Register OBC segment data for restarts.

update_segment_tracer_reservoirs()

Update the OBC tracer reservoirs after the tracers have been updated.

remap_obc_fields()

Vertically remap the OBC tracer reservoirs and radiation rates that are filtered in time.

adjustsegmentetatofitbathymetry()

Adjust interface heights to fit the bathymetry and diagnose layer thickness.

rotate_obc_config()

This is more of a rotate initialization than an actual rotate.

rotate_obc_segment_config()

Rotate the OBC segment configuration data from the input to model index map.

rotate_obc_init()

Initialize the segments and field-related data of a rotated OBC.

rotate_obc_segment_data()

Rotate an OBC segment’s fields from the input to the model index map.

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

  • % use_io [logical] :: True if segment data is based on file input.

  • % name [character (len=32)] :: a name identifier for the segment data

  • % genre [character (len=8)] :: an identifier for the segment data

  • % scale [real] :: 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 [real(:,:,:),allocatable] :: 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 [integer] :: Number of vertical levels in the source data.

  • % dz_src [real(:,:,:),allocatable] :: vertical grid cell spacing of the incoming segment data in [Z ~> m].

  • % buffer_dst [real(:,:,:),allocatable] :: 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 [real] :: 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 [real] :: 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.

  • % resrv_lfac_out [real] :: 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.

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(:,:,:),allocatable] :: tracer concentration array in rescaled units, like [S ~> ppt] for salinity.

  • % obc_inflow_conc [real] :: tracer 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),pointer] :: metadata describing the tracer

  • % tres [real(:,:,:),allocatable] :: tracer reservoir array in rescaled units, like [S ~> ppt] for salinity.

  • % scale [real] :: A scaling factor for converting the units of input data, like [S ppt-1 ~> 1] for salinity.

  • % is_initialized [logical] :: reservoir values have been set when True

  • % ntr_index [integer] :: index of segment tracer in the global tracer registry

  • % fd_index [integer] :: index of segment tracer in the input fields

type mom_open_boundary/segment_tracer_registry_type

Registry type for tracers on segments.

Type fields:
  • % ntseg [integer] :: number of registered tracer segments

  • % tr [type( obc_segment_tracer_type )(50)] :: array of registered tracers

  • % locked [logical] :: 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 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 [logical] :: If true, applies Flather + Chapman radiation of barotropic gravity waves.

  • % radiation [logical] :: If true, 1D Orlanksi radiation boundary conditions are applied. If False, a gradient condition is applied.

  • % radiation_tan [logical] :: If true, 1D Orlanksi radiation boundary conditions are applied to tangential flows.

  • % radiation_grad [logical] :: If true, 1D Orlanksi radiation boundary conditions are applied to dudv and dvdx.

  • % oblique [logical] :: Oblique waves supported at radiation boundary.

  • % oblique_tan [logical] :: If true, 2D radiation boundary conditions are applied to tangential flows.

  • % oblique_grad [logical] :: If true, 2D radiation boundary conditions are applied to dudv and dvdx.

  • % nudged [logical] :: Optional supplement to radiation boundary.

  • % nudged_tan [logical] :: Optional supplement to nudge tangential velocity.

  • % nudged_grad [logical] :: Optional supplement to nudge normal gradient of tangential velocity.

  • % specified [logical] :: Boundary normal velocity fixed to external value.

  • % specified_tan [logical] :: Boundary tangential velocity fixed to external value.

  • % specified_grad [logical] :: Boundary gradient of tangential velocity fixed to external value.

  • % open [logical] :: Boundary is open for continuity solver, and there are no other parameterized mass fluxes at the open boundary.

  • % gradient [logical] :: Zero gradient at boundary.

  • % values_needed [logical] :: Whether or not any external OBC fields are needed.

  • % u_values_needed [logical] :: Whether or not external u OBC fields are needed.

  • % uamp_values_needed [logical] :: Whether or not external u amplitude OBC fields are needed.

  • % uphase_values_needed [logical] :: Whether or not external u phase OBC fields are needed.

  • % v_values_needed [logical] :: Whether or not external v OBC fields are needed.

  • % vamp_values_needed [logical] :: Whether or not external v amplitude OBC fields are needed.

  • % vphase_values_needed [logical] :: Whether or not external v phase OBC fields are needed.

  • % t_values_needed [logical] :: Whether or not external T OBC fields are needed.

  • % s_values_needed [logical] :: Whether or not external S OBC fields are needed.

  • % z_values_needed [logical] :: Whether or not external zeta OBC fields are needed.

  • % zamp_values_needed [logical] :: Whether or not external zeta amplitude OBC fields are needed.

  • % zphase_values_needed [logical] :: Whether or not external zeta phase OBC fields are needed.

  • % g_values_needed [logical] :: Whether or not external gradient OBC fields are needed.

  • % direction [integer] :: Boundary faces one of the four directions.

  • % is_n_or_s [logical] :: True if the OB is facing North or South and exists on this PE.

  • % is_e_or_w [logical] :: True if the OB is facing East or West and exists on this PE.

  • % is_e_or_w_2 [logical] :: True if the OB is facing East or West anywhere.

  • % field [type( obc_segment_data_type )(:),pointer] :: OBC data.

  • % num_fields [integer] :: number of OBC data fields (e.g. u_normal,u_parallel and eta for Flather)

  • % is_obc [integer] :: i-indices of boundary segment.

  • % ie_obc [integer] :: i-indices of boundary segment.

  • % js_obc [integer] :: j-indices of boundary segment.

  • % je_obc [integer] :: j-indices of boundary segment.

  • % uamp_index [integer] :: Save where uamp is in segmentfield.

  • % uphase_index [integer] :: Save where uphase is in segmentfield.

  • % vamp_index [integer] :: Save where vamp is in segmentfield.

  • % vphase_index [integer] :: Save where vphase is in segmentfield.

  • % zamp_index [integer] :: Save where zamp is in segmentfield.

  • % zphase_index [integer] :: Save where zphase is in segmentfield.

  • % velocity_nudging_timescale_in [real] :: Nudging timescale on inflow [T ~> s].

  • % velocity_nudging_timescale_out [real] :: Nudging timescale on outflow [T ~> s].

  • % on_pe [logical] :: true if any portion of the segment is located in this PE’s data domain

  • % temp_segment_data_exists [logical] :: true if temperature data arrays are present

  • % salt_segment_data_exists [logical] :: true if salinity data arrays are present

  • % cg [real(:,:),allocatable] :: The external gravity wave speed [L T-1 ~> m s-1] at OBC-points.

  • % htot [real(:,:),allocatable] :: The total column thickness [H ~> m or kg m-2] at OBC-points.

  • % dztot [real(:,:),allocatable] :: The total column vertical extent [Z ~> m] at OBC-points.

  • % h [real(:,:,:),allocatable] :: The cell thickness [H ~> m or kg m-2] at OBC-points.

  • % normal_vel [real(:,:,:),allocatable] :: The layer velocity normal to the OB segment [L T-1 ~> m s-1].

  • % tangential_vel [real(:,:,:),allocatable] :: The layer velocity tangential to the OB segment [L T-1 ~> m s-1], discretized at the corner points.

  • % tangential_grad [real(:,:,:),allocatable] :: The gradient of the velocity tangential to the OB segment [T-1 ~> s-1], discretized at the corner points.

  • % normal_trans [real(:,:,:),allocatable] :: The layer transport normal to the OB segment [H L2 T-1 ~> m3 s-1].

  • % normal_vel_bt [real(:,:),allocatable] :: The barotropic velocity normal to the OB segment [L T-1 ~> m s-1].

  • % ssh [real(:,:),allocatable] :: The sea-surface elevation along the segment [Z ~> m].

  • % grad_normal [real(:,:,:),allocatable] :: 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 [real(:,:,:),allocatable] :: 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 [real(:,:,:),allocatable] :: 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 [real(:,:,:),allocatable] :: The previous normal phase speed use for EW radiation OBC, in grid points per timestep [nondim].

  • % ry_norm_rad [real(:,:,:),allocatable] :: The previous normal phase speed use for NS radiation OBC, in grid points per timestep [nondim].

  • % rx_norm_obl [real(:,:,:),allocatable] :: The previous x-direction normalized radiation coefficient for either EW or NS oblique OBCs [L2 T-2 ~> m2 s-2].

  • % ry_norm_obl [real(:,:,:),allocatable] :: The previous y-direction normalized radiation coefficient for either EW or NS oblique OBCs [L2 T-2 ~> m2 s-2].

  • % cff_normal [real(:,:,:),allocatable] :: The denominator for oblique radiation of the normal velocity [L2 T-2 ~> m2 s-2].

  • % nudged_normal_vel [real(:,:,:),allocatable] :: The layer velocity normal to the OB segment that values should be nudged towards [L T-1 ~> m s-1].

  • % nudged_tangential_vel [real(:,:,:),allocatable] :: 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 [real(:,:,:),allocatable] :: The layer dvdx or dudy towards which nudging can occur [T-1 ~> s-1].

  • % tr_reg [type( segment_tracer_registry_type ),pointer] :: A pointer to the tracer registry for the segment.

  • % hi [type( hor_index_type )] :: Horizontal index ranges.

  • % tr_invlscale_out [real] :: 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 [real] :: An effective inverse length scale for restoring the tracer concentration 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:
  • % number_of_segments [integer] :: The number of open-boundary segments.

  • % ke [integer] :: The number of model layers.

  • % open_u_bcs_exist_globally [logical] :: True if any zonal velocity points in the global domain use open BCs.

  • % open_v_bcs_exist_globally [logical] :: True if any meridional velocity points in the global domain use open BCs.

  • % flather_u_bcs_exist_globally [logical] :: True if any zonal velocity points in the global domain use Flather BCs.

  • % flather_v_bcs_exist_globally [logical] :: True if any meridional velocity points in the global domain use Flather BCs.

  • % oblique_bcs_exist_globally [logical] :: True if any velocity points in the global domain use oblique BCs.

  • % nudged_u_bcs_exist_globally [logical] :: True if any velocity points in the global domain use nudged BCs.

  • % nudged_v_bcs_exist_globally [logical] :: True if any velocity points in the global domain use nudged BCs.

  • % specified_u_bcs_exist_globally [logical] :: True if any zonal velocity points in the global domain use specified BCs.

  • % specified_v_bcs_exist_globally [logical] :: True if any meridional velocity points in the global domain use specified BCs.

  • % radiation_bcs_exist_globally [logical] :: True if radiations BCs are in use anywhere.

  • % user_bcs_set_globally [logical] :: True if any OBC_USER_CONFIG is set for input from user directory.

  • % update_obc [logical] :: Is OBC data time-dependent.

  • % update_obc_seg_data [logical] :: Is it the time for OBC segment data update for fields that require less frequent update.

  • % needs_io_for_data [logical] :: Is any i/o needed for OBCs on the current PE.

  • % any_needs_io_for_data [logical] :: Is any i/o needed for OBCs globally.

  • % some_need_no_io_for_data [logical] :: Are there any PEs with OBCs that do not need i/o.

  • % zero_vorticity [logical] :: If True, sets relative vorticity to zero on open boundaries.

  • % freeslip_vorticity [logical] :: If True, sets normal gradient of tangential velocity to zero in the relative vorticity on open boundaries.

  • % computed_vorticity [logical] :: If True, uses external data for tangential velocity in the relative vorticity on open boundaries.

  • % specified_vorticity [logical] :: If True, uses external data for tangential velocity gradients in the relative vorticity on open boundaries.

  • % zero_strain [logical] :: If True, sets strain to zero on open boundaries.

  • % freeslip_strain [logical] :: If True, sets normal gradient of tangential velocity to zero in the strain on open boundaries.

  • % computed_strain [logical] :: If True, uses external data for tangential velocity to compute normal gradient in the strain on open boundaries.

  • % specified_strain [logical] :: If True, uses external data for tangential velocity gradients to compute strain on open boundaries.

  • % zero_biharmonic [logical] :: If True, zeros the Laplacian of flow on open boundaries for use in the biharmonic viscosity term.

  • % brushcutter_mode [logical] :: If True, read data on supergrid.

  • % tracer_x_reservoirs_used [logical(:),allocatable] :: Dimensioned by the number of tracers, set globally, true for those with x reservoirs (needed for restarts).

  • % tracer_y_reservoirs_used [logical(:),allocatable] :: Dimensioned by the number of tracers, set globally, true for those with y reservoirs (needed for restarts).

  • % ntr [integer] :: number of tracers

  • % n_tide_constituents [integer] :: Number of tidal constituents to add to the boundary.

  • % add_tide_constituents [logical] :: If 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)(:),allocatable] :: Names of tidal constituents to add to the boundary data.

  • % tide_frequencies [real(:),allocatable] :: Angular frequencies of chosen tidal constituents [T-1 ~> s-1].

  • % tide_eq_phases [real(:),allocatable] :: Equilibrium phases of chosen tidal constituents [rad].

  • % tide_fn [real(:),allocatable] :: Amplitude modulation of boundary tides by nodal cycle [nondim].

  • % tide_un [real(:),allocatable] :: Phase modulation of boundary tides by nodal cycle [rad].

  • % add_eq_phase [logical] :: If true, add the equilibrium phase argument to the specified boundary tidal phase.

  • % add_nodal_terms [logical] :: If 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 )(:),allocatable] :: List of segment objects.

  • % segnum_u [integer(:,:),allocatable] :: Segment number of u-points.

  • % segnum_v [integer(:,:),allocatable] :: Segment number of v-points.

  • % obgc_segments_props [type( external_tracers_segments_props ),pointer] :: obgc segment properties

  • % num_obgc_tracers [integer] :: The total number of obgc tracers.

  • % gamma_uv [real] :: 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 [real] :: The maximum magnitude of the baroclinic radiation velocity (or speed of characteristics) in units of grid points per timestep [nondim].

  • % obc_pe [logical] :: Is there an open boundary on this tile?

  • % remap_cs [type( remapping_cs ),pointer] :: ALE remapping control structure for segments only.

  • % obc_reg [type( obc_registry_type ),pointer] :: Registry type for boundaries.

  • % rx_normal [real(:,:,:),allocatable] :: Array storage for normal phase speed for EW radiation OBCs in units of grid points per timestep [nondim].

  • % ry_normal [real(:,:,:),allocatable] :: Array storage for normal phase speed for NS radiation OBCs in units of grid points per timestep [nondim].

  • % rx_oblique_u [real(:,:,:),allocatable] :: X-direction oblique boundary condition radiation speeds squared at u points for restarts [L2 T-2 ~> m2 s-2].

  • % ry_oblique_u [real(:,:,:),allocatable] :: Y-direction oblique boundary condition radiation speeds squared at u points for restarts [L2 T-2 ~> m2 s-2].

  • % rx_oblique_v [real(:,:,:),allocatable] :: X-direction oblique boundary condition radiation speeds squared at v points for restarts [L2 T-2 ~> m2 s-2].

  • % ry_oblique_v [real(:,:,:),allocatable] :: Y-direction oblique boundary condition radiation speeds squared at v points for restarts [L2 T-2 ~> m2 s-2].

  • % cff_normal_u [real(:,:,:),allocatable] :: Denominator for normalizing EW oblique boundary condition radiation rates at u points for restarts [L2 T-2 ~> m2 s-2].

  • % cff_normal_v [real(:,:,:),allocatable] :: Denominator for normalizing NS oblique boundary condition radiation rates at v points for restarts [L2 T-2 ~> m2 s-2].

  • % tres_x [real(:,:,:,:),allocatable] :: Array storage of tracer reservoirs for restarts, in unscaled units [conc].

  • % tres_y [real(:,:,:,:),allocatable] :: Array storage of tracer reservoirs for restarts, in unscaled units [conc].

  • % debug [logical] :: If true, write verbose checksums for debugging purposes.

  • % silly_h [real] :: 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 [real] :: 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 [logical] :: If True, ramp from zero to the external values for SSH.

  • % ramping_is_activated [logical] :: True if the ramping has been initialized.

  • % ramp_timescale [real] :: If ramp is True, use this timescale for ramping [T ~> s].

  • % trunc_ramp_time [real] :: If ramp is True, time after which ramp is done [T ~> s].

  • % ramp_value [real] :: If 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 [integer] :: 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.

  • % pass_oblique [type(group_pass_type)] :: Structure for group halo pass.

type mom_open_boundary/file_obc_cs

Control structure for open boundaries that read from files. Probably lots to update here.

Type fields:
  • % tide_flow [real] :: Placeholder for now…, perhaps in [m3 s-1]?

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 [integer] :: number of registered open boundary types.

  • % ob [type( obc_struct_type )(max_fields)] :: array of registered boundary types.

  • % locked [logical] :: New 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, private] :: pointer to the next node

  • % tracer_name [character (len=128),private] :: tracer name

  • % tracer_src_file [character (len=128),private] :: tracer source file for BC

  • % tracer_src_field [character (len=128),private] :: name of the field in source file to extract BC

  • % lfac_in [real,private] :: multiplicative factor for inbound tracer reservoir length scale [nondim]

  • % lfac_out [real,private] :: multiplicative 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 :: [in] Parameter file handle

  • obc :: Open boundary control structure

Call to:

initialize_obc_tides mom_remapping::initialize_remapping mask_outside_obcs mdl mom_error_handler::mom_error obc_none open_boundary_dealloc open_boundary_query mom_string_functions::remove_spaces setup_u_point_obc setup_v_point_obc

subroutine mom_open_boundary/initialize_segment_data(G, GV, US, OBC, PF)

Allocate space for reading OBC data from files. It sets up the required vertical remapping. In the process, it does funky stuff with the MPI processes.

Parameters:
  • g :: [in] Ocean grid structure

  • 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

Call to:

get_obgc_segments_props mdl mom_error_handler::mom_error mom_error_handler::mom_mesg parse_segment_data_str parse_segment_manifest_str scale_factor_from_name

function mom_open_boundary/scale_factor_from_name(name, GV, US, Tr_Reg) [real]

Return an appropriate dimensional scaling factor for input data based on an OBC segment data name, 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

  • gv :: [in] Container for vertical grid information

  • us :: [in] A dimensional unit scaling type

  • tr_reg :: pointer to tracer registry for this segment

Call to:

mom_string_functions::uppercase

Called from:

initialize_segment_data

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 :: [in] Parameter file handle

Call to:

mom_tidal_forcing::astro_longitudes_init mom_tidal_forcing::eq_phase mdl mom_error_handler::mom_mesg mom_tidal_forcing::nodal_fu mom_tidal_forcing::tidal_frequency

Called from:

open_boundary_config

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 :: [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

Called from:

rotate_obc_segment_config setup_u_point_obc setup_v_point_obc

subroutine mom_open_boundary/setup_u_point_obc(OBC, G, US, segment_str, l_seg, 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] which segment is this?

  • pf :: [in] Parameter file handle

  • reentrant_y :: [in] is the domain reentrant in y?

Call to:

allocate_obc_segment_data mdl mom_error_handler::mom_error obc_direction_e obc_direction_w parse_segment_str setup_segment_indices

Called from:

open_boundary_config

subroutine mom_open_boundary/setup_v_point_obc(OBC, G, US, segment_str, l_seg, 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] which segment is this?

  • pf :: [in] Parameter file handle

  • reentrant_x :: [in] is the domain reentrant in x?

Call to:

allocate_obc_segment_data mdl mom_error_handler::mom_error obc_direction_n obc_direction_s parse_segment_str setup_segment_indices

Called from:

open_boundary_config

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 :: [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?

Call to:

mom_string_functions::extract_word interpret_int_expr mom_error_handler::mom_error

Called from:

setup_u_point_obc setup_v_point_obc

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 :: [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

Call to:

mom_string_functions::extract_word

Called from:

initialize_segment_data parse_for_tracer_reservoirs

subroutine mom_open_boundary/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]

Call to:

mom_string_functions::extract_word mom_error_handler::mom_error

Called from:

initialize_segment_data parse_for_tracer_reservoirs

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 :: [in] If true, T and S are used

Call to:

mdl parse_segment_data_str parse_segment_manifest_str

Called from:

open_boundary_register_restarts

subroutine mom_open_boundary/open_boundary_init(G, GV, US, param_file, OBC, restart_CS)

Initialize open boundary control structure and do any necessary rescaling of OBC fields that have been read from a restart file.

Parameters:
  • g :: [in] Ocean grid structure

  • gv :: [in] Container for vertical grid information

  • us :: [in] A dimensional unit scaling type

  • param_file :: [in] Parameter file handle

  • obc :: Open boundary control structure

  • restart_cs :: [in] Restart structure, data intent(inout)

Call to:

id_clock_pass

Called from:

rotate_obc_init

function mom_open_boundary/open_boundary_query(OBC, apply_open_OBC, apply_specified_OBC, apply_Flather_OBC, apply_nudged_OBC, needs_ext_seg_data) [logical]
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

Called from:

open_boundary_config

subroutine mom_open_boundary/open_boundary_dealloc(OBC)

Deallocate open boundary data.

Parameters:

obc :: Open boundary control structure

Call to:

deallocate_obc_segment_data

Called from:

open_boundary_config open_boundary_end

subroutine mom_open_boundary/open_boundary_end(OBC)

Close open boundary data.

Parameters:

obc :: Open boundary control structure

Call to:

open_boundary_dealloc

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 :: [inout] Bathymetry at h-points, in [Z ~> m] or other units

Call to:

obc_direction_e obc_direction_n obc_direction_s obc_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_e obc_direction_s obc_direction_w obc_none

Called from:

mom_fixed_initialization::mom_initialize_fixed

subroutine mom_open_boundary/setup_obc_tracer_reservoirs(G, GV, OBC)

Make sure the OBC tracer reservoirs are initialized.

Parameters:
  • g :: [in] Ocean grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • obc :: [inout] Open boundary control structure

Called from:

fill_temp_salt_segments

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 :: [inout] On exit, new u values on open boundaries On entry, the old time-level v 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]

Call to:

gradient_at_q_points id_clock_pass obc_direction_e obc_direction_n obc_direction_s obc_direction_w open_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 :: [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]

Called from:

radiation_open_bdry_conds

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 :: [inout] u field to update on open boundaries [arbitrary]

  • v :: [inout] v field to update on open boundaries [arbitrary]

Called from:

mom_dynamics_unsplit::step_mom_dyn_unsplit mom_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 :: [inout] OBC segment structure

  • uvel :: [in] zonal velocity [L T-1 ~> m s-1]

  • vvel :: [in] meridional velocity [L T-1 ~> m s-1]

Call to:

obc_direction_e obc_direction_n

Called from:

radiation_open_bdry_conds

subroutine mom_open_boundary/set_tracer_data(OBC, tv, h, G, GV, PF)

Sets the initial values of the tracer open boundary conditions. Redoing this elsewhere.

Parameters:
  • g :: [inout] Ocean grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • obc :: [in] Open boundary structure

  • tv :: [inout] Thermodynamics structure

  • h :: [inout] Layer thicknesses [H ~> m or kg m-2]

  • pf :: [in] Parameter file handle

Call to:

obc_direction_e obc_direction_n obc_direction_s obc_direction_w

function mom_open_boundary/lookup_seg_field(OBC_seg, field) [integer]

Needs documentation.

Parameters:
  • obc_seg :: [in] OBC segment

  • field :: [in] The field name

function mom_open_boundary/get_tracer_index(OBC_seg, tr_name) [integer]

Return the tracer index from its name.

Parameters:
  • obc_seg :: OBC segment

  • tr_name :: [in] The field name

Called from:

fill_obgc_segments update_obc_segment_data

subroutine mom_open_boundary/allocate_obc_segment_data(OBC, segment)

Allocate segment data fields.

Parameters:
  • obc :: [in] Open boundary structure

  • segment :: [inout] Open boundary segment

Called from:

rotate_obc_config setup_u_point_obc setup_v_point_obc

subroutine mom_open_boundary/deallocate_obc_segment_data(segment)

Deallocate segment data fields.

Parameters:

segment :: [inout] Open boundary segment

Call to:

segment_tracer_registry_end

Called from:

open_boundary_dealloc

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 :: [inout] Zonal velocity [L T-1 ~> m s-1]

  • v :: [inout] Meridional velocity [L T-1 ~> m s-1]

Call to:

obc_direction_e obc_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 :: [inout] Layer thickness [H ~> m or kg m-2]

Call to:

obc_direction_e obc_direction_n

Called from:

mom_dynamics_split_rk2::step_mom_dyn_split_rk2 mom_dynamics_split_rk2b::step_mom_dyn_split_rk2b

subroutine mom_open_boundary/update_obc_segment_data(G, GV, US, OBC, tv, 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

  • tv :: [in] Thermodynamics structure

  • h :: [inout] Thickness [H ~> m or kg m-2]

  • time :: [in] Model time

Call to:

adjustsegmentetatofitbathymetry get_tracer_index obc_direction_e obc_direction_n obc_direction_s obc_direction_w

Called from:

mom_state_initialization::mom_initialize_state

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 :: [in] Specify whether to record the value of Time as the beginning of the ramp period

Called from:

mom_dynamics_split_rk2::initialize_dyn_split_rk2 mom_dynamics_split_rk2b::initialize_dyn_split_rk2b mom_dynamics_split_rk2::step_mom_dyn_split_rk2 mom_dynamics_split_rk2b::step_mom_dyn_split_rk2b

subroutine mom_open_boundary/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

Call to:

obc_registry_init

Called from:

dyed_channel_initialization::register_dyed_channel_obc register_file_obc

subroutine mom_open_boundary/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

Called from:

register_obc

function mom_open_boundary/register_file_obc(param_file, CS, US, OBC_Reg) [logical]

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.

Call to:

register_obc

Called from:

mom_boundary_update::call_obc_register

subroutine mom_open_boundary/file_obc_end(CS)

Clean up the file OBC from registry.

Parameters:

cs :: OBC file control structure.

Called from:

mom_boundary_update::obc_register_end

subroutine mom_open_boundary/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

Call to:

mdl

Called from:

register_segment_tracer

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 :: A 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 :: [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 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 :: [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 :: [in] index of segment tracer in the input field

Call to:

segment_tracer_registry_init

Called from:

dome_initialization::dome_set_obc_data dyed_obcs_initialization::dyed_obcs_set_obc_data register_obgc_segments register_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:

deallocate_obc_segment_data

subroutine mom_open_boundary/register_temp_salt_segments(GV, US, OBC, tr_Reg, param_file)
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

Call to:

register_segment_tracer

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 :: [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]

Called from:

mom_generic_tracer::register_mom_generic_tracer_segments

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 :: 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]

Called from:

initialize_segment_data

subroutine mom_open_boundary/register_obgc_segments(GV, OBC, tr_Reg, param_file, tr_name)
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

Call to:

register_segment_tracer

subroutine mom_open_boundary/fill_obgc_segments(G, GV, OBC, tr_ptr, tr_name)
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

Call to:

get_tracer_index obc_direction_s obc_direction_w

subroutine mom_open_boundary/fill_temp_salt_segments(G, GV, US, OBC, tv)
Parameters:
  • g :: [in] Ocean grid structure

  • gv :: [in] ocean vertical grid structure

  • us :: [in] Unit scaling

  • obc :: Open boundary structure

  • tv :: [inout] Thermodynamics structure

Call to:

obc_direction_s obc_direction_w setup_obc_tracer_reservoirs

Called from:

rotate_obc_init

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 :: [in] Parameter file handle

  • obc :: Open boundary structure

  • us :: [in] A dimensional unit scaling type

Call to:

flood_fill flood_fill2 mdl obc_direction_e obc_direction_n obc_direction_s obc_direction_w obc_none

Called from:

open_boundary_config

subroutine mom_open_boundary/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

Called from:

mask_outside_obcs

subroutine mom_open_boundary/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

Called from:

mask_outside_obcs

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 :: [in] Parameter file handle

  • restart_cs :: [inout] MOM restart control structure

  • use_temperature :: [in] If true, T and S are used

Call to:

parse_for_tracer_reservoirs

subroutine mom_open_boundary/update_segment_tracer_reservoirs(G, GV, uhr, vhr, h, OBC, dt, 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 :: [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

  • dt :: [in] time increment [T ~> s]

  • reg :: pointer to tracer registry

Call to:

obc_direction_s obc_direction_w

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 :: [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

Call to:

obc_direction_s obc_direction_w

subroutine mom_open_boundary/adjustsegmentetatofitbathymetry(G, GV, US, segment, fld)

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 :: [inout] OBC segment

  • fld :: [in] field index to adjust thickness

Called from:

update_obc_segment_data

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 metric

  • obc :: [inout] Rotated OBC

  • g :: [in] Rotated grid metric

  • turns :: [in] Number of quarter turns

Call to:

allocate_obc_segment_data rotate_obc_segment_config rotate_obc_segment_data

Called from:

mom::initialize_mom

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 :: [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

Call to:

obc_direction_e obc_direction_n obc_direction_s obc_direction_w obc_none setup_segment_indices

Called from:

rotate_obc_config

subroutine mom_open_boundary/rotate_obc_init(OBC_in, G, GV, US, param_file, tv, restart_CS, OBC)

Initialize the segments and field-related data of a rotated OBC.

Parameters:
  • obc_in :: [in] OBC on input map

  • g :: [in] Rotated grid metric

  • gv :: [in] Vertical grid

  • us :: [in] Unit scaling

  • param_file :: [in] Input parameters

  • tv :: [inout] Tracer fields

  • restart_cs :: [in] Restart CS

  • obc :: [inout] Rotated OBC

Call to:

fill_temp_salt_segments open_boundary_init rotate_obc_segment_data

Called from:

mom::initialize_mom

subroutine mom_open_boundary/rotate_obc_segment_data(segment_in, segment, turns)

Rotate an OBC segment’s fields from the input to the model index map.

Called from:

rotate_obc_config rotate_obc_init