MOM6
external_gwave_initialization Module Reference

Detailed Description

Initialization for the "external gravity wave wave" configuration.

Functions/Subroutines

subroutine, public external_gwave_initialize_thickness (h, G, GV, US, param_file, just_read_params)
 This subroutine initializes layer thicknesses for the external_gwave experiment. More...
 

Function/Subroutine Documentation

◆ external_gwave_initialize_thickness()

subroutine, public external_gwave_initialization::external_gwave_initialize_thickness ( real, dimension( g %isd: g %ied, g %jsd: g %jed, gv %ke), intent(out)  h,
type(ocean_grid_type), intent(in)  G,
type(verticalgrid_type), intent(in)  GV,
type(unit_scale_type), intent(in)  US,
type(param_file_type), intent(in)  param_file,
logical, intent(in), optional  just_read_params 
)

This subroutine initializes layer thicknesses for the external_gwave experiment.

Parameters
[in]gThe ocean's grid structure.
[in]gvThe ocean's vertical grid structure.
[in]usA dimensional unit scaling type
[out]hThe thickness that is being initialized [H ~> m or kg m-2].
[in]param_fileA structure indicating the open file to parse for model parameter values.
[in]just_read_paramsIf present and true, this call will only read parameters without changing h.

Definition at line 29 of file external_gwave_initialization.F90.

29  type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
30  type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
31  type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
32  real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
33  intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2].
34  type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
35  !! to parse for model parameter values.
36  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
37  !! only read parameters without changing h.
38  ! Local variables
39  real :: eta1D(SZK_(G)+1)! Interface height relative to the sea surface
40  ! positive upward [Z ~> m].
41  real :: ssh_anomaly_height ! Vertical height of ssh anomaly
42  real :: ssh_anomaly_width ! Lateral width of anomaly
43  logical :: just_read ! If true, just read parameters but set nothing.
44  character(len=40) :: mdl = "external_gwave_initialize_thickness" ! This subroutine's name.
45 ! This include declares and sets the variable "version".
46 #include "version_variable.h"
47  integer :: i, j, k, is, ie, js, je, nz
48  real :: PI, Xnondim
49 
50  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
51 
52  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
53 
54  if (.not.just_read) &
55  call mom_mesg(" external_gwave_initialization.F90, external_gwave_initialize_thickness: setting thickness", 5)
56 
57  if (.not.just_read) call log_version(param_file, mdl, version, "")
58  call get_param(param_file, mdl, "SSH_ANOMALY_HEIGHT", ssh_anomaly_height, &
59  "The vertical displacement of the SSH anomaly. ", units="m", &
60  fail_if_missing=.not.just_read, do_not_log=just_read, scale=us%m_to_Z)
61  call get_param(param_file, mdl, "SSH_ANOMALY_WIDTH", ssh_anomaly_width, &
62  "The lateral width of the SSH anomaly. ", units="coordinate", &
63  fail_if_missing=.not.just_read, do_not_log=just_read)
64 
65  if (just_read) return ! All run-time parameters have been read, so return.
66 
67  pi = 4.0*atan(1.0)
68  do j=g%jsc,g%jec ; do i=g%isc,g%iec
69  xnondim = (g%geoLonT(i,j)-g%west_lon-0.5*g%len_lon) / ssh_anomaly_width
70  xnondim = min(1., abs(xnondim))
71  eta1d(1) = ssh_anomaly_height * 0.5 * ( 1. + cos(pi*xnondim) ) ! Cosine bell
72  do k=2,nz
73  eta1d(k) = -g%max_depth & ! Stretch interior interfaces with SSH
74  + (eta1d(1)+g%max_depth) * ( real(nz+1-k)/real(nz) ) ! Stratification
75  enddo
76  eta1d(nz+1) = -g%max_depth ! Force bottom interface to bottom
77  do k=1,nz
78  h(i,j,k) = gv%Z_to_H * (eta1d(k) - eta1d(k+1))
79  enddo
80  enddo ; enddo
81 

References mom_error_handler::mom_mesg().

Referenced by mom_state_initialization::mom_initialize_state().

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