Module ocean_residency_meta_mod
OVERVIEW
Ocean residency module
This module contains the meta definitions, subroutines and functions
to use in the ocean residency package. These routines are used by all
of the ocean residency modules and need to be defined in a separate
module so that there are no circular references between the modules.
For an overview of the ocean residency modules, see ocean_residency.F90.
OTHER MODULES USED
field_manager_mod
fm_util_mod
mpp_mod
PUBLIC INTERFACE
PUBLIC DATA
None.
PUBLIC ROUTINES
-
ocean_residency_get_instances
-
DESCRIPTION
- Return an array of instances which have the given module_name
This is used by modules, such as the mixed layer module, to obtain
a list of instances which use that module. Then, the module
needs only to loop over those instance to perform its required tasks.
-
ocean_residency_set_region_2d
-
DESCRIPTION
- Given a 2-d field of depths, determine the grid cells which fall inside (above) and
outside of that range, then set the mask appropriately, as to whether
we are interested in those points inside (swap=false) or outside (swap=true) of the region.
Note: if the output array is not initialized, then it is assumed that it is already
filled with a region, and the resulting region will be the intersection of the
existing region and the newly specified region.
Arguments:
Input:
isd: low dimension of first index
ied: high dimension of first index
jsd: low dimension of second index
jed: high dimension of second index
nk: dimension of third index
control: array of depths that specifies the region
depth_zwt: depth of bottom of grid cell
restore_region_value: if supplied, the value to assign to array in the user-specified
regions (default: 0.0)
integrate_region_value: if supplied, the value to assign to array outside of the
user-specified regions (default: secs_in_year_r)
swap: if supplied and true then change the invert the defined region (default: true)
initialize: if supplied and true, then initialize the region to the integrate_region_value (default: false)
caller: if supplied, use for traceback of error messages (default: fm_default_caller)
Input/Output:
array: 3-d array which will contain the restore_region- and integrate_region-
values.
-
ocean_residency_set_region_geog
-
DESCRIPTION
- Set up an array covering the model domain with a user-specified
value, in user-specified regions. There are a given number of
3-d regions specified by the values south_bnd, north_bnd, west_bnd,
east_bnd, top_bnd and bottom_bnd.
The longitudes are for a cyclic domain, and if west_bnd and east_bnd
are on opposite sides of the cut, the correct thing will
be done. east_bnd is considered to be east of west_bnd, so if east_bnd is
less than west_bnd, then the region east of east_bnd to the cut will be
filled, and the region from the cut to west_bnd will be filled.
If the bottom bound is less than or equal to zero, then the top model box
will be chosen. If the top bound is greater than or equal to the maximum
model depth, then the bottom box will be chosed. Otherwise, if the grid
cell center depth falls between top bound and bottom bound, then those cells
shall be chosen.
For longitude and latitude, if the grid cell center lies within the
rectabgle defined by (west_bnd,south_bnd) and (east_bnd,north_bnd), then
the whole grid cell is inside the region.
Arrays of coordinates may be specified for irregular regions.
The final region is the union of the multiple sets
of coordinates. If swap is true, then the inverse of the defined
region will be set.
Note: if the output array is not initialized, then it is assumed that it is already
filled with a region, and the resulting region will be the intersection of the
existing region and the newly specified region.
Arguments:
Input:
isd: low dimension of first index
ied: high dimension of first index
jsd: low dimension of second index
jed: high dimension of second index
nk: dimension of third index
grid_xt: array of coordinates in the x-direction (typically longitude)
grid_yt: array of coordinates in the y-direction (typically latitude)
max_depth: maximum depth of the model
depth_zt: depth of center of grid cell
depth_zwt: depth of bottom of grid cell
num_geog_regions: number of user-specified regions which will be filled
west_bnd_in: 1-d array of western (starting) longitudes for the regions
east_bnd_in: 1-d array of eastern (ending) longitudes for the regions
south_bnd: 1-d array of southern (starting) latitudes for the regions
north_bnd: 1-d array of northern (ending) latitudes for the regions
top_bnd: 1-d array of southern (starting) depths for the regions
bottom_bnd: 1-d array of northern (ending) depths for the regions
Note: if south_bnd >= north_bnd, then nothing is done
for that region
kmt: array of indices for bottom grid cells
name: character variable used in informative messages
restore_region_value: if supplied, the value to assign to array in the user-specified
regions (default: 0.0)
integrate_region_value: if supplied, the value to assign to array outside of the
user-specified regions (default: secs_in_year_r)
swap: if supplied and true then change the invert the defined region (default: true)
Input/Output:
array: 3-d array which will contain the restore_region- and integrate_region-
values.
-
ocean_residency_set_region_3d
-
DESCRIPTION
- Set up an array where the a grid box is in the region if the value
of the specified property (temperature, say) is within the given bounds.
Multiple values for the range may be given, and the resulting mask
will be the union of the multiple regions. If swap is true, then the
inverse of the selected region will be set.
Note: if the output array is not initialized, then it is assumed that it is already
filled with a region, and the resulting region will be the intersection of the
existing region and the newly specified region.
Arguments:
Input:
isd: low dimension of first index
ied: high dimension of first index
jsd: low dimension of second index
jed: high dimension of second index
nk: dimension of third index
num_geog_regions: number of user-specified regions which will be filled
bounds: 1-d array of pairs of bounding values. The first value in
the pair must be less than the second value
kmt: array of indices for bottom grid cells
name: character variable used in informative messages
restore_region_value: if supplied, the value to assign to array in the user-specified
regions (default: 0.0)
integrate_region_value: if supplied, the value to assign to array outside of the
user-specified regions (default: secs_in_year_r)
swap: if supplied and true then change the invert the defined region (default: true)
initialize: if supplied and true, then initialize the region to the integrate_region_value (default: false)
caller: if supplied, use for traceback of error messages (default: fm_default_caller)
Input/Output:
array: 3-d array which will contain the restore_region- and integrate_region-
values.
DATA SETS
None.
ERROR MESSAGES
None.