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)
 This subroutine deallocates memory in the control structure for the coord_sigma module. More...
 
subroutine, public set_sigma_params (CS, min_thickness)
 This subroutine can be used to set the parameters for the coord_sigma module. More...
 
subroutine, public build_sigma_column (CS, 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,
real, intent(in)  depth,
real, intent(in)  totalThickness,
real, dimension(cs%nk+1), intent(inout)  zInterface 
)

Build a sigma coordinate column.

Parameters
[in]csCoordinate control structure
[in]depthDepth of ocean bottom (positive [H ~> m or kg m-2])
[in]totalthicknessColumn thickness (positive [H ~> m or kg m-2])
[in,out]zinterfaceAbsolute positions of interfaces [H ~> m or kg m-2]

Definition at line 64 of file coord_sigma.F90.

64  type(sigma_CS), intent(in) :: CS !< Coordinate control structure
65  real, intent(in) :: depth !< Depth of ocean bottom (positive [H ~> m or kg m-2])
66  real, intent(in) :: totalThickness !< Column thickness (positive [H ~> m or kg m-2])
67  real, dimension(CS%nk+1), intent(inout) :: zInterface !< Absolute positions of interfaces [H ~> m or kg m-2]
68 
69  ! Local variables
70  integer :: k
71 
72  zinterface(cs%nk+1) = -depth
73  do k = cs%nk,1,-1
74  zinterface(k) = zinterface(k+1) + (totalthickness * cs%coordinateResolution(k))
75  ! Adjust interface position to accommodate inflating layers
76  ! without disturbing the interface above
77  if (zinterface(k) < (zinterface(k+1) + cs%min_thickness)) then
78  zinterface(k) = zinterface(k+1) + cs%min_thickness
79  endif
80  enddo

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

Here is the caller graph for this function:

◆ end_coord_sigma()

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

This subroutine deallocates memory in the control structure for the coord_sigma module.

Parameters
csCoordinate control structure

Definition at line 43 of file coord_sigma.F90.

43  type(sigma_CS), pointer :: CS !< Coordinate control structure
44 
45  ! nothing to do
46  if (.not. associated(cs)) return
47  deallocate(cs%coordinateResolution)
48  deallocate(cs)

Referenced by mom_regridding::end_regridding().

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
[in]nkNumber of layers in the grid
[in]coordinateresolutionNominal coordinate resolution [nondim]

Definition at line 29 of file coord_sigma.F90.

29  type(sigma_CS), pointer :: CS !< Unassociated pointer to hold the control structure
30  integer, intent(in) :: nk !< Number of layers in the grid
31  real, dimension(:), intent(in) :: coordinateResolution !< Nominal coordinate resolution [nondim]
32 
33  if (associated(cs)) call mom_error(fatal, "init_coord_sigma: CS already associated!")
34  allocate(cs)
35  allocate(cs%coordinateResolution(nk))
36 
37  cs%nk = nk
38  cs%coordinateResolution = coordinateresolution

References mom_error_handler::mom_error().

Referenced by mom_regridding::initcoord().

Here is the call graph for this function:
Here is the caller 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 
)

This subroutine can be used to set the parameters for the coord_sigma module.

Parameters
csCoordinate control structure
[in]min_thicknessMinimum allowed thickness [H ~> m or kg m-2]

Definition at line 53 of file coord_sigma.F90.

53  type(sigma_CS), pointer :: CS !< Coordinate control structure
54  real, optional, intent(in) :: min_thickness !< Minimum allowed thickness [H ~> m or kg m-2]
55 
56  if (.not. associated(cs)) call mom_error(fatal, "set_sigma_params: CS not associated")
57 
58  if (present(min_thickness)) cs%min_thickness = min_thickness

References mom_error_handler::mom_error().

Referenced by mom_regridding::set_regrid_params().

Here is the call graph for this function:
Here is the caller graph for this function: