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.

obc_segment_thickness_type

Thickness on OBC segment data structure, with a reservoir.

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.

open_boundary_setup_vert()

Setup vertical remapping for open boundaries.

segment_determine_required_fields()

Determine which physical fields are required for this segment based on boundary-condition type and segment orientation.

find_phys_field_index()

Find physical field index from name.

allocate_segment_field_data()

Allocate data (buffer_src, buffer_dst and dz_src) for a field at an OBC segment.

initialize_segment_data()

Get and store properties about the fields on the OBC segments and allocate space for reading OBC data from files.

field_is_on_face()

Determine whether a particular field is descretized at the normal-velocity faces of an open boundary condition segment.

field_is_tidal()

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.

set_segnum_signs()

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.

scale_factor_from_name()

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.

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_halo_update()

Do any necessary halo updates on OBC-related fields.

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()

Initialize the tracer reservoirs values, perhaps only if they have not been set via a restart file.

setup_obc_thickness_reservoirs()

Initialize the thickness reservoirs values, perhaps only if they have not been set via a restart file.

set_initialized_obc_tracer_reservoirs()

Record that the tracer reservoirs have been initialized so that their values are not reset later.

copy_thickness_reservoirs()

Fill segmenth_Reg from restart fields.

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.

lookup_seg_field()

Return the field number on the segment for the named field, or -1 if there is no field with that name.

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).

read_obc_segment_data()

Read OBC values on the segments from files.

update_obc_segment_data()

Update the OBC values on the segments.

initialize_obc_segment_reservoirs()

Initialize thickness and tracer reservoirs to external value.

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.

segment_thickness_reservoir_init()

Initialize all the segment thickness reservoirs.

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.

segment_thickness_registry_end()

Clean up the segment thickness object.

register_temp_salt_segments()

Registers the temperature and salinity in the segment tracer registry.

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()

Registers a named tracer in the segment tracer registries for the OBC segments on which it is active.

fill_obgc_segments()

Stores the interior tracer values on the segment, and in some cases also sets the tracer reservoir values.

fill_temp_salt_segments()

Set the value of temperatures and salinities on OBC segments.

fill_thickness_segments()

Set the value of temperatures and salinities on OBC 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.

update_segment_thickness_reservoirs()

Update the OBC thickness reservoirs after the thicknesses 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_segment_direction()

Return the direction of an OBC segment on after rotation to the new grid.

rotated_field_name()

Return the that the field would have after being rotated by the given number of quarter turns.

allocate_rotated_seg_data()

Allocate an array of data for a field on a segment based on the size of a potentially rotated source array.

write_obc_info()

Write out information about the contents of the OBC control structure.

chksum_obc_segments()

Write checksums and perhaps some or all of the values of all the allocated arrays on the OBC segments.

chksum_obc_segment_data()

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 :: logical True if this field is required.

  • % use_io :: logical True 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 :: integer If this field is a tracer, its index in registry is stored here.

  • % bgc_tracer :: logical True if this field is a BGC tracer.

  • % on_face :: logical If true, this field is discretized on the OBC segment (velocity-point) faces, or if false it as the vorticiy points.

  • % 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, dimension(:,:,:), 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, dimension(:,:,:), allocatable vertical grid cell spacing of the incoming segment data in [Z ~> m].

  • % buffer_dst :: real, dimension(:,:,:), 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 or thickness.

  • % 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 or thickness.

[source]

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(:,:,:), 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, dimension(:,:,:), 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

[source]

type  mom_open_boundary/obc_segment_thickness_type

Thickness on OBC segment data structure, with a reservoir.

Type fields:
  • % h :: real, dimension(:,:,:), allocatable layer thickness array in rescaled units, [Z ~> m].

  • % obc_inflow_conc :: real layer thickness for generic inflows in rescaled units, [Z ~> m].

  • % name :: character(len=32) thickness name used for error messages

  • % h_res :: real, dimension(:,:,:), allocatable thickness reservoir array in rescaled units, [Z ~> m].

  • % scale :: real A scaling factor for converting the units of input data, [Z m-1 ~> 1].

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

  • % fd_index :: integer index of segment thickness in the input fields

[source]

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), dimension(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…

[source]

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.

  • % 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), dimension(:), pointer OBC data.

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

  • % is_obc :: integer Starting local i-index of boundary segment, this may be outside of the local PE.

  • % ie_obc :: integer Ending local i-index of boundary segment, this may be outside of the local PE.

  • % js_obc :: integer Starting local j-index of boundary segment, this may be outside of the local PE.

  • % je_obc :: integer Ending local j-index of boundary segment, this may be outside of the local PE.

  • % 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, dimension(:,:), allocatable The external gravity wave speed [L T-1 ~> m s-1] at OBC-points.

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

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

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

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

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

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

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

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

  • % normal_trans_bt :: real, dimension(:,:), allocatable The barotropic transport normal the OB segment [H L2 T-1 ~> m3 s-1 or kg s-1].

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

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

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

  • % tidal_elev :: real, dimension(:,:), allocatable Tidal elevation at the OBC points [Z ~> m].

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

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

  • % rx_norm_obl :: real, dimension(:,:,:), 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, dimension(:,:,:), allocatable The previous y-direction normalized radiation coefficient for either EW or NS oblique OBCs [L2 T-2 ~> m2 s-2].

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

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

  • % h_reg :: type(obc_segment_thickness_type), pointer A pointer to the thickness for the segment.

  • % 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].

  • % th_invlscale_out :: real An effective inverse length scale for restoring the layer thickness in a fictitious reservoir towards interior values when flow is exiting the domain [L-1 ~> m-1].

  • % th_invlscale_in :: real An effective inverse length scale for restoring the layer thickness towards an externally imposed value when flow is entering [L-1 ~> m-1].

[source]

type  mom_open_boundary/ocean_obc_type

Open-boundary data.

Type fields:
  • % is_u_w_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % ie_u_w_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % js_u_w_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % je_u_w_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % is_u_e_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % ie_u_e_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % js_u_e_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % je_u_e_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % is_v_s_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % ie_v_s_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % js_v_s_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % je_v_s_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % is_v_n_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % ie_v_n_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % js_v_n_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % je_v_n_obc :: integer Index ranges on the local PE for the open boundary conditions in various directions.

  • % number_of_segments :: integer The number of open-boundary segments.

  • % reverse_segment_order :: logical If true, store the segments internally in the reversed order.

  • % 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.

  • % vorticity_config :: integer An integer indicating OBC relative vorticity configuration.

  • % strain_config :: integer An integer indicating OBC strain configuration.

  • % 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, dimension(:), allocatable Dimensioned by the number of tracers, set globally, true for those with x reservoirs (needed for restarts).

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

  • % thickness_x_reservoirs_used :: logical True for thichness reservoirs in x (needed for restarts).

  • % thickness_y_reservoirs_used :: logical True for thichness reservoirs in y (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), dimension(:), allocatable Names of tidal constituents to add to the boundary data.

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

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

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

  • % tide_un :: real, dimension(:), 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), dimension(:), allocatable List of segment objects.

  • % segnum_u :: integer, dimension(:,:), allocatable The absolute value gives the segment number of any OBCs at u-points, while the sign indicates whether they are Eastern (> 0) or Western (< 0) OBCs, with 0 for velocities that are not on an OBC.

  • % segnum_v :: integer, dimension(:,:), allocatable The absolute value gives the segment number of any OBCs at v-points, while the sign indicates whether they are Northern (> 0) or Southern (< 0) OBCs, with 0 for velocities that are not on an OBC.

  • % obgc_segments_props :: 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?

  • % u_obcs_on_pe :: logical True if there are any u-point OBCs on this PE, including in its halos.

  • % v_obcs_on_pe :: logical True if there are any v-point OBCs on this PE, including in its halos.

  • % v_n_obcs_on_pe :: logical True if there are any northern v-point OBCs on this PE, including in its halos.

  • % v_s_obcs_on_pe :: logical True if there are any southern v-point OBCs on this PE, including in its halos.

  • % u_e_obcs_on_pe :: logical True if there are any eastern u-point OBCs on this PE, including in its halos.

  • % u_w_obcs_on_pe :: logical True if there are any western u-point OBCs on this PE, including in its halos.

  • % remap_z_cs :: type(remapping_cs), pointer ALE remapping control structure for z-space data on segments.

  • % remap_h_cs :: type(remapping_cs), pointer ALE remapping control structure for thickness-based fields on segments.

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

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

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

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

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

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

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

  • % cff_normal_u :: real, dimension(:,:,:), 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, dimension(:,:,:), allocatable Denominator for normalizing NS oblique boundary condition radiation rates at v points for restarts [L2 T-2 ~> m2 s-2].

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

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

  • % h_res_x :: real, dimension(:,:,:), allocatable Array storage of thickness reservoirs for restarts, [Z ~> m].

  • % h_res_y :: real, dimension(:,:,:), allocatable Array storage of thickness reservoirs for restarts, [Z ~> m].

  • % use_h_res :: logical If true, use thickness reservoirs.

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

  • % nk_obc_debug :: integer The number of layers of OBC segment data to write out in full when DEBUG_OBCS is true.

  • % 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.

  • % check_reconstruction :: logical Flag for remapping to run checks on reconstruction.

  • % check_remapping :: logical Flag for remapping to run internal checks.

  • % force_bounds_in_subcell :: logical Flag for remapping to hide overshoot using bounds.

  • % om4_remap_via_sub_cells :: logical If 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 :: logical If true, use incorrect form of tracers exterior to OBCs.

  • % hor_index_bug :: logical If true, recover set of a horizontal indexing bugs in the OBC code.

  • % reservoir_init_bug :: logical If true, set the OBC tracer reservoirs at the startup of a new run from the interior tracer concentrations regardless of properties that may be explicitly specified for the reservoir concentrations.

  • % ts_needed_bug :: logical If true, recover a bug that temperature and salinity can be ignored even if they are registered tracers in the rest of the model.

[source]

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 :: logical Placeholder for now to avoid an empty type.

[source]

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.

[source]

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), dimension(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.

[source]

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]

[source]

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 handle

  • obc :: Open boundary control structure

Call to:

initialize_obc_tides mask_outside_obcs mdl mom_error_handler::mom_error obc_none obc_strain_computed obc_strain_freeslip obc_strain_none obc_strain_specified obc_strain_zero obc_vorticity_computed obc_vorticity_freeslip obc_vorticity_none obc_vorticity_specified obc_vorticity_zero open_boundary_dealloc open_boundary_query mom_string_functions::remove_spaces set_segnum_signs setup_u_point_obc setup_v_point_obc

[source]

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:

mom_remapping::initialize_remapping

[source]

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 segment

  • tides :: tides [in] Switch for tidal variables

  • temp_salt :: temp_salt [in] Switch for thermodynamic variables

Call to:

f_s f_t f_u f_uphase f_uy f_v f_vamp f_vphase f_vx f_z f_zamp f_zphase mom_error_handler::mom_error

Called from:

initialize_segment_data

[source]

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_fields phys_field_names

Called from:

initialize_segment_data

[source]

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 segment

  • obc :: [in] Open boundary control structure

  • segment :: segment [inout] Segment to work on

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

  • inputdir :: inputdir [in] The directory of input files

  • filename :: filename [in] Input file name

  • varname :: varname [in] Variable name in the input file

  • suffix :: 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 grid

  • nz :: nz [in] Default k-axis size in buffer_dst

Call to:

field_is_on_face field_is_tidal mom_error_handler::mom_error scale_factor_from_name

Called from:

initialize_segment_data

[source]

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 grid

  • use_temperature :: use_temperature [in] If true, temperature and salinity used as state variables.

Call to:

allocate_segment_field_data chksum_obc_segment_data f_s f_t find_phys_field_index get_obgc_segments_props get_tracer_index mdl mom_error_handler::mom_error num_phys_fields parse_segment_data_str parse_segment_manifest_str phys_field_names rotated_field_name segment_determine_required_fields

[source]

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 interpret

  • is_e_or_w :: [in] This is true for an eastern or western open boundary condition

Called from:

allocate_segment_field_data

[source]

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:

allocate_segment_field_data read_obc_segment_data

[source]

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_s obc_direction_w

Called from:

open_boundary_config rotate_obc_config

[source]

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 interpret

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

  • tr_reg :: pointer to tracer registry for this segment

Call to:

mom_string_functions::uppercase

Called from:

allocate_segment_field_data

[source]

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_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

[source]

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

[source]

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 number

  • l_seg_io :: l_seg_io [in] The segment number used for reading parameters

  • pf :: [in] Parameter file handle

  • reentrant_y :: 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

[source]

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 number

  • l_seg_io :: l_seg_io [in] The segment number used for reading parameters

  • pf :: [in] Parameter file handle

  • reentrant_x :: 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

[source]

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 direction

  • nj_global :: nj_global [in] Number of h-points in meridional direction

  • segment_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=l

  • m :: m [out] The value of J=m, if segment_str begins with I=, or the value of I=m

  • n :: n [out] The value of J=n, if segment_str begins with I=, or the value of I=n

  • action_str :: action_str [out] The “string” part of segment_str

  • reentrant :: 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

[source]

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 data

  • fields :: fields [out] List of fieldnames for each segment

Call to:

mom_string_functions::extract_word mom_error_handler::mom_error num_phys_fields

Called from:

initialize_segment_data parse_for_tracer_reservoirs

[source]

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 record

  • var :: var [in] The name of the variable for which parameters are needed

  • filename :: filename [out] The name of the input file if using “file” method

  • fieldname :: fieldname [out] The name of the variable in the input file if using “file” method

  • value :: 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

[source]

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:

mdl parse_segment_data_str parse_segment_manifest_str

Called from:

open_boundary_register_restarts

[source]

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

[source]

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:

open_boundary_config

[source]

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

[source]

subroutine mom_open_boundary/open_boundary_end(OBC)

Close open boundary data.

Parameters:

obc :: Open boundary control structure

Call to:

open_boundary_dealloc

[source]

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

[source]

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

Called from:

mom_fixed_initialization::mom_initialize_fixed

[source]

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

[source]

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

[source]

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:

mom_state_initialization::mom_initialize_obcs

[source]

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

[source]

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_segments gradient_at_q_points id_clock_pass obc_direction_e obc_direction_n obc_direction_s obc_direction_w open_boundary_apply_normal_flow

[source]

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:

radiation_open_bdry_conds

[source]

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_unsplit mom_dynamics_unsplit_rk2::step_mom_dyn_unsplit_rk2

[source]

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 structure

  • uvel :: 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_e obc_direction_n

Called from:

radiation_open_bdry_conds

[source]

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

[source]

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:

fill_obgc_segments initialize_segment_data

[source]

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_computed obc_strain_specified obc_vorticity_computed obc_vorticity_specified

Called from:

rotate_obc_config setup_u_point_obc setup_v_point_obc

[source]

subroutine mom_open_boundary/deallocate_obc_segment_data(segment)

Deallocate segment data fields.

Parameters:

segment :: segment [inout] Open boundary segment

Call to:

segment_thickness_registry_end segment_tracer_registry_end

Called from:

open_boundary_dealloc

[source]

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_e obc_direction_n

[source]

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_e obc_direction_n

[source]

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 structure

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

  • time :: [in] Model time

Call to:

adjustsegmentetatofitbathymetry field_is_tidal

[source]

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_u f_uamp f_uphase f_uy f_v f_vamp f_vphase f_vx f_z f_zamp f_zphase num_phys_fields

[source]

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

[source]

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

[source]

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 messages

  • param_file :: 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

[source]

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 parameters

  • reg :: pointer to OBC registry

Called from:

register_obc

[source]

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:

register_obc

Called from:

mom_boundary_update::call_obc_register

[source]

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

[source]

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 parameters

  • segment :: segment [inout] the segment

Call to:

mdl

Called from:

register_segment_tracer

[source]

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 parameters

  • gv :: [in] ocean vertical grid structure

  • us :: [in] Unit scaling type

  • obc :: Open boundary structure

Call to:

mdl

Called from:

mom::initialize_mom

[source]

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_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 :: ntr_index [in] index of segment tracer in the global tracer registry

  • param_file :: param_file [in] file to parse for model parameter values

  • segment :: 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 :: 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:

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

[source]

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

[source]

subroutine mom_open_boundary/segment_thickness_registry_end(Reg)

Clean up the segment thickness object.

Parameters:

reg :: pointer to thickness reservoir

Called from:

deallocate_obc_segment_data

[source]

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:

register_segment_tracer

[source]

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 name

  • obc_src_file_name :: obc_src_file_name [in] OBC source file name

  • obc_src_field_name :: obc_src_field_name [in] name of the field in the source file

  • lfac_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]

[source]

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 :: node pointer to tracer segment properties

  • tr_name :: tr_name [out] Tracer name

  • obc_src_file_name :: obc_src_file_name [out] OBC source file name

  • obc_src_field_name :: obc_src_field_name [out] name of the field in the source file

  • lfac_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:

initialize_segment_data

[source]

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 values

  • tr_name :: tr_name [in] Tracer name

Call to:

register_segment_tracer

[source]

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_ptr Pointer to tracer field in scaled concentration units, like [S ~> ppt] for salinity.

  • tr_name :: tr_name [in] Tracer name

Call to:

get_tracer_index obc_direction_e obc_direction_n obc_direction_s obc_direction_w

[source]

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_s obc_direction_w

[source]

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_s obc_direction_w

[source]

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 handle

  • obc :: Open boundary structure

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

Call to:

flood_fill flood_fill2 mdl

Called from:

open_boundary_config

[source]

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 domain

  • cout :: cout [in] color for outside the domain

  • cland :: cland [in] color for inside the land mask

Called from:

mask_outside_obcs

[source]

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 domain

  • cout :: cout [in] color for outside the domain

  • cland :: cland [in] color for inside the land mask

Called from:

mask_outside_obcs

[source]

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 handle

  • restart_cs :: [inout] MOM restart control structure

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

Call to:

parse_for_tracer_reservoirs

[source]

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_s obc_direction_w

[source]

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_s obc_direction_w

Called from:

mom_dynamics_split_rk2::step_mom_dyn_split_rk2 mom_dynamics_split_rk2b::step_mom_dyn_split_rk2b

[source]

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_s obc_direction_w

[source]

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 segment

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

  • at_node :: at_node [in] True this point is at the OBC nodes rather than the faces

Called from:

read_obc_segment_data

[source]

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_data rotate_obc_segment_config set_segnum_signs

[source]

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 segment

  • g_in :: [in] Input grid metric

  • segment :: segment [inout] Rotated OBC segment

  • g :: [in] Rotated grid metric

  • turns :: turns [in] Number of quarter turns

Call to:

obc_direction_e obc_direction_n obc_direction_s obc_direction_w rotate_obc_segment_direction setup_segment_indices

Called from:

rotate_obc_config

[source]

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 grid

  • turns :: turns [in] Number of quarter turns

Return:

undefined :: An integer encoding the new rotated segment direction

Call to:

obc_direction_e obc_direction_n obc_direction_s obc_direction_w obc_none

Called from:

rotate_obc_segment_config shelfwave_initialization::shelfwave_set_obc_data write_obc_info

[source]

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 name

  • turns :: turns [in] Number of quarter turns of the grid

Return:

undefined :: The rotated field name

Called from:

initialize_segment_data

[source]

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 grid

  • hi_in :: [in] Horizontal indices on the source grid

  • tgt_array :: tgt_array [inout] The segment data that is being allocated

  • segment :: segment [inout] OBC segment on the target grid

[source]

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_segments obc_direction_e obc_direction_n obc_direction_s obc_direction_w rotate_obc_segment_direction

[source]

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:

chksum_obc_segment_data

Called from:

radiation_open_bdry_conds write_obc_info

[source]

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 checksum

  • gv :: [in] Vertical grid

  • us :: [in] Unit scaling

  • nk :: nk [in] The number of layers to print

  • nseg_out :: nseg_out [in] The segment number reported in output

Call to:

obc_direction_e obc_direction_n obc_direction_s obc_direction_w write_2d_array_vals write_3d_array_vals

Called from:

chksum_obc_segments initialize_segment_data

[source]

[source]