Module ocean_operators_mod
OVERVIEW
Operators for MOM
This module computes discrete operators used by MOM.
OTHER MODULES USED
mpp_domains_mod
mpp_mod
fms_mod
ocean_domains_mod
ocean_parameters_mod
ocean_types_mod
PUBLIC INTERFACE
PUBLIC ROUTINES
-
ocean_operators_init
-
DESCRIPTION
-
Initialize the operator module
-
set_barotropic_domain
-
DESCRIPTION
-
Set the barotropic domain used in barotropic time step.
-
INPUT
-
| Domain_in |
Store the barotropic domain.
[type(ocean_domain_type)] |
-
get_use_legacy_DIV_UD
-
DESCRIPTION
-
Return the value of ocean_operators_nml variable use_legacy_DIV_UD
-
REMAP_NT_TO_NU
-
DESCRIPTION
-
REMAP_NT_TO_NU remaps a normal flux at the north
face of T-cells to the north face of U-cells
-
INPUT
-
| a |
Field to be remapped
[real, dimension(isd:ied,jsd:jed)] |
-
REMAP_ET_TO_EU
-
DESCRIPTION
-
REMAP_ET_TO_EU remaps a normal flux at the east
face of T-cells to the east face of U-cells
-
INPUT
-
| a |
Field to be remapped
[real, dimension(isd:ied,jsd:jed)] |
-
REMAP_BT_TO_BU
-
DESCRIPTION
-
REMAP_BT_TO_BU remaps a T-cell thickness or
vertical velocity on the base of T-cells to U-cells
-
INPUT
-
| a |
Field to be remapped
[real, dimension(isd:ied,jsd:jed)] |
-
DIV_UD
-
DESCRIPTION
-
Compute divergence of vertically integrated velocity.
For MOM with generalized vertical coordinates, ud has an extra
density factor built in.
The Bgrid uh and vh fields are located on the corner points, so require
some backward averaging.
The Cgrid uh and vh fields are located on the T-cell faces, so need no
spatial averaging.
Bgrid code is a speedier version of
uhy(:,:) = BAY(ud(:,:,1)*dyu(:,:))
vhx(:,:) = BAX(ud(:,:,2)*dxu(:,:))
DIV_UD(ud) = BDX_ET(uhy(:,:)/dyte(:,:)) + BDY_NT(vhx(:,:)/dxtn(:,:))
-
GRAD_BAROTROPIC_P
-
DESCRIPTION
-
Compute horizontal gradient of the pressure field associated with
either the free surface height or the bottom pressure.
Account taken here for either Bgrid or Cgrid operators.
For the Bgrid, the gradient is centered onto the U-cell
for use in updating barotropic velocity. For the Cgrid, the
two components are centred on the T-cell faces.
The Bgrid algorithm is a speedier version of
grad_barotropic_p(:,:,1) = FDX_NT(FAY(press(:,:)))
grad_barotropic_p(:,:,2) = FDY_ET(FAX(press(:,:)))
-
S2D
-
DESCRIPTION
-
Smooth a 2D field with a 2D version of a 1D filter with weights (1/4, 1/2, 1/4)
-
INPUT
-
| a |
Field to be smoothed
[real, dimension(isd:ied,jsd:jed)] |
-
LAP_T
-
DESCRIPTION
-
Compute horizontal 5-point Laplacian operator on eta_t.
Result lives at T-cell center.
Redundancy update for tripolar is needed to conserve
total volume and tracer. It is likely unimportant
when call LAP_T from within the barotropic loop. Yet it
is essential when call LAP_T from ocean_surface_smooth.
Mixing coefficient is assumed to be centred on the T-cell.
It is averaged to compute its value on the i-face and j-face
for computing fluxes.
-
FAX
-
DESCRIPTION
-
Forwards average in the i-direction on the X-axis.
If input is a(i,j) then output is defined at (i+1/2,j)
-
INPUT
-
| a |
Field to be averaged
[real, dimension(isd:ied,jsd:jed)] |
-
BAX
-
DESCRIPTION
-
Backwards average in the i-direction along the X-axis.
If input is a(i,j) then output is defined at (i-1/2,j)
-
INPUT
-
| a |
Field to be averaged
[real, dimension(isd:ied,jsd:jed)] |
-
FAY
-
DESCRIPTION
-
Forwards average in the j-direction on the Y-axis
If input is a(i,j) then output is defined at (i,j+1/2)
-
INPUT
-
| a |
Field to be averaged
[real, dimension(isd:ied,jsd:jed)] |
-
BAY
-
DESCRIPTION
-
Backwards average in the j-direction along the Y-axis
If input is a(i,j) then output is defined at (i,j-1/2)
-
INPUT
-
| a |
Field to be averaged
[real, dimension(isd:ied,jsd:jed)] |
-
BDX_EU
-
DESCRIPTION
-
Backwards Derivative in X of a quantity defined on the East face of a U-cell
If input is a(i,j) then output is defined at (i-1/2,j)
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
-
BDX_ET
-
DESCRIPTION
-
Backwards derivative in X of a quantity defined on the East face of a T-cell.
If input is a(i,j) then output is defined at (i-1/2,j)
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
-
FDX_U
-
DESCRIPTION
-
Forward Derivative in X of a quantity defined on the grid point of a U-cell.
If input is a(i,j) then output is defined at (i+1/2,j).
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
-
FDX_ZT
-
DESCRIPTION
-
Forward Derivative in X of a quantity defined on a tracer grid point
where it is necessary to take derivative with depth held constant.
When grid points live at different depths, then have an extra
contribution to the derivative.
Input a(i,j,1) is at the grid point of a T-cell at level k-1.
Input a(i,j,2) is at the grid point of a T-cell at level k.
Output is defined at (i+1/2,j) which is at the east face in a T-cell at level k.
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
| k |
Depth level
[integer] |
-
FDX_T
-
DESCRIPTION
-
Forward Derivative in X of a quantity defined on the grid point
of a T-cell.
For lateral derivatives where vertical coordinate is held constant.
Input a(i,j) is at the grid point of a T-cell
Output is defined at (i+1/2,j) which is at the east face in a T-cell.
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
-
FDY_ZT
-
DESCRIPTION
-
Forward Derivative in Y of a quantity defined on a tracer grid point
where it is necessary to take derivative with depth held constant.
When grid points live at different depths, then have an extra
contribution to the derivative.
Input a(i,j,1) is at the grid point of a T-cell at level k-1.
Input a(i,j,2) is at the grid point of a T-cell at level k.
Output is defined at (i,j+1/2) which is at the north face in a T-cell at level k.
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
| k |
Depth level
[integer] |
-
FDY_T
-
DESCRIPTION
-
Forward Derivative in Y of a quantity defined on the grid Point
of a T-cell.
For lateral derivatives where vertical coordinate is held constant.
Input a(i,j) is at the grid point of a T-cell.
Output is defined at (i,j+1/2) which is at the north face in a T-cell.
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
-
FDX_NT
-
DESCRIPTION
-
Forward Derivative in X of a quantity defined on the North face of a T-cell.
If input is a(i,j) then output is defined at (i+1/2,j).
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
-
BDY_NU
-
DESCRIPTION
-
Backward Derivative in Y of a quantity defined on the North face of a U-cell.
If input is a(i,j) then output is defined at (i,j-1/2).
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
-
BDY_NT
-
DESCRIPTION
-
Backward Derivative in Y of a quantity defined on the North face of a T-cell.
If input is a(i,j) then output is defined at (i,j-1/2).
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
-
FDY_U
-
DESCRIPTION
-
Forward Derivative in Y of a quantity defined on the grid Point of a U-cell.
If input is a(i,j) then output is defined at (i,j+1/2).
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
-
FDY_ET
-
DESCRIPTION
-
Forward Derivative in Y of a quantity defined on the East face of a T-cell.
If input is a(i,j) then output is defined at (i,j+1/2).
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
-
FDZ_T
-
DESCRIPTION
-
Forward Derivative in Z of a field on the T-cell point at level k.
input a(i,j,1) is at the grid point of a T-cell at level k.
input a(i,j,2) is at the grid point of a T-cell at level k+1.
output is at (i,j,k+3/2) which is bottom face of T-cell at level k.
minus sign due to convention that z-increases upwards, whereas
k increases downward.
-
INPUT
-
| a |
Field to be finite differenced
[real, dimension(isd:ied,jsd:jed)] |
| k |
Depth level index
[integer] |
-
FMX
-
DESCRIPTION
-
Forwards Minimum in the X direction.
If input is a(i,j) then output is defined at (i+1/2,j).
-
INPUT
-
| a |
Field to find minimum
[real, dimension(isd:ied,jsd:jed)] |
-
FMY
-
DESCRIPTION
-
Forwards Minimum in the Y direction.
If input is a(i,j) then output is defined at (i,j+1/2).
-
INPUT
-
| a |
Field to find minimum
[real, dimension(isd:ied,jsd:jed)] |
NAMELIST
&ocean_operators_nml
-
use_legacy_DIV_UD
Set use_legacy_DIV_UD=.true. to reproduce Riga results for
DIV_UD on Bgrid. For the case that the model grid is tripolar grid,
when barotropic_halo > 1 in ocean_barotropic.F90, then
we must set use_legacy_DIV_UD=.false., since will not reproduce between
different number of processors if set use_legacy_DIV_UD=.true.
Tests indicate that with wider barotropic halos, there are
some performance enhancements for use_legacy_DIV_UD=.false.
Hence, the default is use_legacy_DIV_UD=.false.
For the case that the model grid is regular lat-lon grid,
use_legacy_DIV_UD could be set to .true. or .false. for
any positive value of barotropic_halo.
Note that the only difference between the new and old DIV_UD
is order of operations induced by parentheses, which occurs in the
tripolar fold region in the Arctic:
old: DIV_UD(i,j) = (uh_bay - uhim_bay + vh_bax - vhjm_bax)*datr_bt(i,j)
new: DIV_UD(i,j) = ((uh_bay - uhim_bay) + (vh_bax - vhjm_bax))*datr_bt(i,j)
[logical]
NOTES
All operators will be replaced by generic forms when Fortran
can properly support functions of allocatable arrays. The
problems presently with this replacement are are as follows:
Allocatable arrays cannot be inside of derived types.
Only pointers to allocatable arrays can be inside derived types.
Supposedly the former will be allowed in Fortran 95
Also, functions cannot be typed as a derived type without conflicts
which preclude using function as general operators operating on
derived types.
Mnemonics for simple operators
1st letter (direction of operation)
F => Forward direction with respect to the index.
B => Backward direction with respect to the index.
2nd letter (operation)
D => Derivative
A => Average
M => Minimum
3rd letter (axis)
X => along the X axis
Y => along the Y axis
Z => along the Z axis
4th letter (placement of quantity being operated on)
E => East face
N => North face
B => Bottom face
P => Point (grid point within cell)
5th letter (type of grid cell)
U => U-cell
T => T-cell