MOM6
coord_sigma Module Reference

Detailed Description

Regrid columns for the sigma coordinate.

Data Types

type  sigma_cs
 Control structure containing required parameters for the sigma coordinate. More...
 

Functions/Subroutines

subroutine, public init_coord_sigma (CS, nk, coordinateResolution)
 Initialise a sigma_CS with pointers to parameters. More...
 
subroutine, public end_coord_sigma (CS)
 
subroutine, public set_sigma_params (CS, min_thickness)
 
subroutine, public build_sigma_column (CS, nz, depth, totalThickness, zInterface)
 Build a sigma coordinate column. More...
 

Function/Subroutine Documentation

◆ build_sigma_column()

subroutine, public coord_sigma::build_sigma_column ( type(sigma_cs), intent(in)  CS,
integer, intent(in)  nz,
real, intent(in)  depth,
real, intent(in)  totalThickness,
real, dimension(nz+1), intent(inout)  zInterface 
)

Build a sigma coordinate column.

Parameters
[in]csCoordinate control structure
[in]nzNumber of levels
[in]depthDepth of ocean bottom (positive in m)
[in]totalthicknessColumn thickness (positive in m)
[in,out]zinterfaceAbsolute positions of interfaces

Definition at line 61 of file coord_sigma.F90.

Referenced by mom_regridding::build_sigma_grid(), and mom_diag_remap::diag_remap_update().

61  type(sigma_cs), intent(in) :: cs !< Coordinate control structure
62  integer, intent(in) :: nz !< Number of levels
63  real, intent(in) :: depth !< Depth of ocean bottom (positive in m)
64  real, intent(in) :: totalthickness !< Column thickness (positive in m)
65  real, dimension(nz+1), intent(inout) :: zinterface !< Absolute positions of interfaces
66 
67  ! Local variables
68  integer :: k
69 
70  zinterface(nz+1) = -depth
71  do k = nz,1,-1
72  zinterface(k) = zinterface(k+1) + (totalthickness * cs%coordinateResolution(k))
73  ! Adjust interface position to accomodate inflating layers
74  ! without disturbing the interface above
75  if (zinterface(k) < (zinterface(k+1) + cs%min_thickness)) then
76  zinterface(k) = zinterface(k+1) + cs%min_thickness
77  endif
78  enddo
Here is the caller graph for this function:

◆ end_coord_sigma()

subroutine, public coord_sigma::end_coord_sigma ( type(sigma_cs), pointer  CS)

Definition at line 41 of file coord_sigma.F90.

Referenced by mom_regridding::end_regridding().

41  type(sigma_cs), pointer :: cs
42 
43  ! nothing to do
44  if (.not. associated(cs)) return
45  deallocate(cs%coordinateResolution)
46  deallocate(cs)
Here is the caller graph for this function:

◆ init_coord_sigma()

subroutine, public coord_sigma::init_coord_sigma ( type(sigma_cs), pointer  CS,
integer, intent(in)  nk,
real, dimension(:), intent(in)  coordinateResolution 
)

Initialise a sigma_CS with pointers to parameters.

Parameters
csUnassociated pointer to hold the control structure

Definition at line 28 of file coord_sigma.F90.

References mom_error_handler::mom_error().

28  type(sigma_cs), pointer :: cs !< Unassociated pointer to hold the control structure
29  integer, intent(in) :: nk
30  real, dimension(:), intent(in) :: coordinateresolution
31 
32  if (associated(cs)) call mom_error(fatal, "init_coord_sigma: CS already associated!")
33  allocate(cs)
34  allocate(cs%coordinateResolution(nk))
35 
36  cs%nk = nk
37  cs%coordinateResolution = coordinateresolution
Here is the call graph for this function:

◆ set_sigma_params()

subroutine, public coord_sigma::set_sigma_params ( type(sigma_cs), pointer  CS,
real, intent(in), optional  min_thickness 
)

Definition at line 50 of file coord_sigma.F90.

References mom_error_handler::mom_error().

50  type(sigma_cs), pointer :: cs
51  real, optional, intent(in) :: min_thickness
52 
53  if (.not. associated(cs)) call mom_error(fatal, "set_sigma_params: CS not associated")
54 
55  if (present(min_thickness)) cs%min_thickness = min_thickness
Here is the call graph for this function: