MOM6
|
Routines for initialization callable from MOM6 or Python (MIDAS)
Data Types | |
interface | fill_boundaries |
Fill grid edges. More... | |
Functions/Subroutines | |
real function, dimension(size(tr_in, 1), size(tr_in, 2), nlay), public | tracer_z_init (tr_in, z_edges, e, nkml, nkbl, land_fill, wet, nlay, nlevs, debug, i_debug, j_debug, eps_z) |
Layer model routine for remapping tracers. More... | |
integer function, dimension(size(a, 1), size(x, 1)) | bisect_fast (a, x, lo, hi) |
Return the index where to insert item x in list a, assuming a is sorted. The return values [i] is such that all e in a[:i-1] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, will insert just after the rightmost x already there. Optional args lo (default 1) and hi (default len(a)) bound the slice of a to be searched. More... | |
subroutine, public | determine_temperature (temp, salt, R, p_ref, niter, land_fill, h, k_start, eos) |
This subroutine determines the potential temperature and salinity that is consistent with the target density using provided initial guess. More... | |
subroutine | find_overlap (e, Z_top, Z_bot, k_max, k_start, k_top, k_bot, wt, z1, z2) |
This subroutine determines the layers bounded by interfaces e that overlap with the depth range between Z_top and Z_bot, and also the fractional weights of each layer. It also calculates the normalized relative depths of the range of each layer that overlaps that depth range. Note that by convention, e decreases with increasing k and Z_top > Z_bot. More... | |
real function | find_limited_slope (val, e, k) |
This subroutine determines a limited slope for val to be advected with a piecewise limited scheme. More... | |
real function, dimension(size(rho, 1), size(rho, 2), size(rb, 1)), public | find_interfaces (rho, zin, Rb, depth, nlevs, nkml, nkbl, hml, debug, eps_z, eps_rho) |
Find interface positions corresponding to density profile. More... | |
subroutine, public | meshgrid (x, y, x_T, y_T) |
Create a 2d-mesh of grid coordinates from 1-d arrays. More... | |
subroutine | smooth_heights (zi, fill, bad, sor, niter, cyclic_x, tripolar_n) |
Solve del2 (zi) = 0 using successive iterations with a 5 point stencil. Only points fill==1 are modified. Except where bad==1, information propagates isotropically in index space. The resulting solution in each region is an approximation to del2(zi)=0 subject to boundary conditions along the valid points curve bounding this region. More... | |
integer function, dimension(0:size(m, 1)+1, 0:size(m, 2)+1) | fill_boundaries_int (m, cyclic_x, tripolar_n) |
Fill grid edges. More... | |
real function, dimension(0:size(m, 1)+1, 0:size(m, 2)+1) | fill_boundaries_real (m, cyclic_x, tripolar_n) |
fill grid edges More... | |
|
private |
Return the index where to insert item x in list a, assuming a is sorted. The return values [i] is such that all e in a[:i-1] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, will insert just after the rightmost x already there. Optional args lo (default 1) and hi (default len(a)) bound the slice of a to be searched.
[in] | a | Sorted list |
[in] | x | Item to be inserted |
[in] | lo | Lower bracket of optional range to search |
[in] | hi | Upper bracket of optional range to search |
Definition at line 302 of file midas_vertmap.F90.
Referenced by find_interfaces().
subroutine, public midas_vertmap::determine_temperature | ( | real, dimension(:,:,:), intent(inout) | temp, |
real, dimension(:,:,:), intent(inout) | salt, | ||
real, dimension(size(temp,3)), intent(in) | R, | ||
real, intent(in) | p_ref, | ||
integer, intent(in) | niter, | ||
real, intent(in) | land_fill, | ||
real, dimension(:,:,:), intent(in) | h, | ||
integer, intent(in) | k_start, | ||
type(eos_type), pointer | eos | ||
) |
This subroutine determines the potential temperature and salinity that is consistent with the target density using provided initial guess.
[in,out] | temp | potential temperature [degC] |
[in,out] | salt | salinity [PSU] |
[in] | r | desired potential density [kg m-3]. |
[in] | p_ref | reference pressure [Pa]. |
[in] | niter | maximum number of iterations |
[in] | k_start | starting index (i.e. below the buffer layer) |
[in] | land_fill | land fill value |
[in] | h | layer thickness, used only to avoid working on massless layers |
eos | seawater equation of state control structure |
Definition at line 364 of file midas_vertmap.F90.
|
private |
Fill grid edges.
[in] | m | input array |
[in] | cyclic_x | zonal cyclic condition |
[in] | tripolar_n | northern fold condition |
Definition at line 782 of file midas_vertmap.F90.
References fill_boundaries_real().
|
private |
fill grid edges
[in] | m | input array |
[in] | cyclic_x | zonal cyclic condition |
[in] | tripolar_n | northern fold condition |
Definition at line 802 of file midas_vertmap.F90.
Referenced by fill_boundaries_int().
real function, dimension(size(rho,1),size(rho,2),size(rb,1)), public midas_vertmap::find_interfaces | ( | real, dimension(:,:,:), intent(in) | rho, |
real, dimension(size(rho,3)), intent(in) | zin, | ||
real, dimension(:), intent(in) | Rb, | ||
real, dimension(size(rho,1),size(rho,2)), intent(in) | depth, | ||
real, dimension(size(rho,1),size(rho,2)), intent(in), optional | nlevs, | ||
integer, intent(in), optional | nkml, | ||
integer, intent(in), optional | nkbl, | ||
real, intent(in), optional | hml, | ||
logical, intent(in), optional | debug, | ||
real, intent(in), optional | eps_z, | ||
real, intent(in), optional | eps_rho | ||
) |
Find interface positions corresponding to density profile.
[in] | rho | potential density in z-space [kg m-3 or R ~> kg m-3] |
[in] | zin | Input data levels [m or Z ~> m]. |
[in] | rb | target interface densities [kg m-3 or R ~> kg m-3] |
[in] | depth | ocean depth [Z ~> m]. |
[in] | nlevs | number of valid points in each column |
[in] | debug | optional debug flag |
[in] | nkml | number of mixed layer pieces |
[in] | nkbl | number of buffer layer pieces |
[in] | hml | mixed layer depth [Z ~> m]. |
[in] | eps_z | A negligibly small layer thickness [m or Z ~> m]. |
[in] | eps_rho | A negligibly small density difference [kg m-3 or R ~> kg m-3]. |
Definition at line 563 of file midas_vertmap.F90.
References bisect_fast().
|
private |
This subroutine determines a limited slope for val to be advected with a piecewise limited scheme.
[in] | val | An column the values that are being interpolated. |
[in] | e | A column's interface heights [Z ~> m] or other units. |
[in] | k | The layer whose slope is being determined. |
Definition at line 530 of file midas_vertmap.F90.
Referenced by tracer_z_init().
|
private |
This subroutine determines the layers bounded by interfaces e that overlap with the depth range between Z_top and Z_bot, and also the fractional weights of each layer. It also calculates the normalized relative depths of the range of each layer that overlaps that depth range. Note that by convention, e decreases with increasing k and Z_top > Z_bot.
[in] | e | The interface positions, [Z ~> m] or other units. |
[in] | z_top | The top of the range being mapped to, [Z ~> m] or other units. |
[in] | z_bot | The bottom of the range being mapped to, [Z ~> m] or other units. |
[in] | k_max | The number of valid layers. |
[in] | k_start | The layer at which to start searching. |
[out] | k_top | The index of the top layer that overlap with the depth range. |
[out] | k_bot | The index of the bottom layer that overlap with the depth range. |
[out] | wt | The relative weights of each layer from k_top to k_bot [nondim]. |
[out] | z1 | Depth of the top limit of layer that contributes to a level [nondim]. |
[out] | z2 | Depth of the bottom limit of layer that contributes to a level [nondim]. |
Definition at line 468 of file midas_vertmap.F90.
Referenced by tracer_z_init().
subroutine, public midas_vertmap::meshgrid | ( | real, dimension(:), intent(in) | x, |
real, dimension(:), intent(in) | y, | ||
real, dimension(size(x,1),size(y,1)), intent(inout) | x_T, | ||
real, dimension(size(x,1),size(y,1)), intent(inout) | y_T | ||
) |
Create a 2d-mesh of grid coordinates from 1-d arrays.
[in] | x | input x coordinates |
[in] | y | input y coordinates |
[in,out] | x_t | output 2-d version |
[in,out] | y_t | output 2-d version |
Definition at line 690 of file midas_vertmap.F90.
|
private |
Solve del2 (zi) = 0 using successive iterations with a 5 point stencil. Only points fill==1 are modified. Except where bad==1, information propagates isotropically in index space. The resulting solution in each region is an approximation to del2(zi)=0 subject to boundary conditions along the valid points curve bounding this region.
[in,out] | zi | interface positions [m] or arbitrary |
[in] | fill | points to be smoothed |
[in] | bad | ignore these points |
[in] | sor | successive over-relaxation coefficient (typically 0.6) |
[in] | niter | maximum number of iterations |
[in] | cyclic_x | input grid cyclic condition in the zonal direction |
[in] | tripolar_n | tripolar Arctic fold flag |
Definition at line 718 of file midas_vertmap.F90.
real function, dimension(size(tr_in,1),size(tr_in,2),nlay), public midas_vertmap::tracer_z_init | ( | real, dimension(:,:,:), intent(in) | tr_in, |
real, dimension(size(tr_in,3)+1), intent(in) | z_edges, | ||
real, dimension(size(tr_in,1),size(tr_in,2),nlay+1), intent(in) | e, | ||
integer, intent(in) | nkml, | ||
integer, intent(in) | nkbl, | ||
real, intent(in) | land_fill, | ||
real, dimension(size(tr_in,1),size(tr_in,2)), intent(in) | wet, | ||
integer, intent(in) | nlay, | ||
real, dimension(size(tr_in,1),size(tr_in,2)), intent(in), optional | nlevs, | ||
logical, intent(in), optional | debug, | ||
integer, intent(in), optional | i_debug, | ||
integer, intent(in), optional | j_debug, | ||
real, intent(in), optional | eps_z | ||
) |
Layer model routine for remapping tracers.
[in] | tr_in | The z-space array of tracer concentrations that is read in. |
[in] | z_edges | The depths of the cell edges in the input z* data [Z ~> m or m] |
[in] | nlay | The number of vertical layers in the target grid |
[in] | e | The depths of the target layer interfaces [Z ~> m or m] |
[in] | nkml | The number of mixed layers |
[in] | nkbl | The number of buffer layers |
[in] | land_fill | fill in data over land (1) |
[in] | wet | The wet mask for the source data (valid points) |
[in] | nlevs | The number of input levels with valid data |
[in] | debug | optional debug flag |
[in] | i_debug | i-index of point for debugging |
[in] | j_debug | j-index of point for debugging |
[in] | eps_z | A negligibly small layer thickness [Z ~> m or m]. |
Definition at line 153 of file midas_vertmap.F90.
References find_limited_slope(), and find_overlap().