MOM6
rossby_front_2d_initialization Module Reference

Detailed Description

Initial conditions for the 2D Rossby front test.

Description of the 2d Rossby front initial conditions

Consistent with a linear equation of state, the system has a constant stratification below the mixed layer, stratified in temperature only. Isotherms are flat below the mixed layer and vertical within. Salinity is constant. The mixed layer has a half sine form so that there are no mixed layer or temperature gradients at the side walls.

Below the mixed layer the potential temperature, \(\theta(z)\), is given by

\[ \theta(z) = \theta_0 - \Delta \theta \left( z + h_{ML} \right) \]

where \( \theta_0 \) and \( \Delta \theta \) are external model parameters.

The depth of the mixed layer, \(H_{ML}\) is

\[ h_{ML}(y) = h_{min} + \left( h_{max} - h_{min} \right) \cos{\pi y/L} \]

. The temperature in mixed layer is given by the reference temperature at \(z=h_{ML}\) so that

\[ \theta(y,z) = \theta_0 - \Delta \theta \left( z + h_{ML} \right) & \forall & z < h_{ML}(y) T.B.D. \]

Functions/Subroutines

subroutine, public rossby_front_initialize_thickness (h, G, GV, US, param_file, just_read_params)
 Initialization of thicknesses in 2D Rossby front test. More...
 
subroutine, public rossby_front_initialize_temperature_salinity (T, S, h, G, GV, param_file, eqn_of_state, just_read_params)
 Initialization of temperature and salinity in the Rossby front test. More...
 
subroutine, public rossby_front_initialize_velocity (u, v, h, G, GV, US, param_file, just_read_params)
 Initialization of u and v in the Rossby front test. More...
 
real function ypseudo (G, lat)
 Pseudo coordinate across domain used by Hml() and dTdy() returns a coordinate from -PI/2 .. PI/2 squashed towards the center of the domain. More...
 
real function hml (G, lat)
 Analytic prescription of mixed layer depth in 2d Rossby front test, in the same units as Gmax_depth. More...
 
real function dtdy (G, dT, lat)
 Analytic prescription of mixed layer temperature gradient in 2d Rossby front test. More...
 

Variables

character(len=40) mdl = "Rossby_front_2d_initialization"
 This module's name. More...
 
real, parameter frontfractionalwidth = 0.5
 Width of front as fraction of domain [nondim]. More...
 
real, parameter hmlmin = 0.25
 Shallowest ML as fractional depth of ocean [nondim]. More...
 
real, parameter hmlmax = 0.75
 Deepest ML as fractional depth of ocean [nondim]. More...
 

Function/Subroutine Documentation

◆ dtdy()

real function rossby_front_2d_initialization::dtdy ( type(ocean_grid_type), intent(in)  G,
real, intent(in)  dT,
real, intent(in)  lat 
)
private

Analytic prescription of mixed layer temperature gradient in 2d Rossby front test.

Parameters
[in]gGrid structure
[in]dtTop to bottom temperature difference
[in]latLatitude

Definition at line 256 of file Rossby_front_2d_initialization.F90.

256  type(ocean_grid_type), intent(in) :: G !< Grid structure
257  real, intent(in) :: dT !< Top to bottom temperature difference
258  real, intent(in) :: lat !< Latitude
259  ! Local
260  real :: PI, dHML, dHdy
261  real :: km = 1.e3 ! AXIS_UNITS = 'k' (1000 m)
262 
263  pi = 4.0 * atan(1.0)
264  dhml = 0.5 * ( hmlmax - hmlmin ) * g%max_depth
265  dhdy = dhml * ( pi / ( frontfractionalwidth * g%len_lat * km ) ) * cos( ypseudo(g, lat) )
266  dtdy = -( dt / g%max_depth ) * dhdy
267 

References frontfractionalwidth, hmlmax, hmlmin, and ypseudo().

Referenced by rossby_front_initialize_velocity().

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

◆ hml()

real function rossby_front_2d_initialization::hml ( type(ocean_grid_type), intent(in)  G,
real, intent(in)  lat 
)
private

Analytic prescription of mixed layer depth in 2d Rossby front test, in the same units as Gmax_depth.

Parameters
[in]gGrid structure
[in]latLatitude

Definition at line 243 of file Rossby_front_2d_initialization.F90.

243  type(ocean_grid_type), intent(in) :: G !< Grid structure
244  real, intent(in) :: lat !< Latitude
245  ! Local
246  real :: dHML, HMLmean
247 
248  dhml = 0.5 * ( hmlmax - hmlmin ) * g%max_depth
249  hmlmean = 0.5 * ( hmlmin + hmlmax ) * g%max_depth
250  hml = hmlmean + dhml * sin( ypseudo(g, lat) )

References hmlmax, hmlmin, and ypseudo().

Referenced by rossby_front_initialize_temperature_salinity(), rossby_front_initialize_thickness(), and rossby_front_initialize_velocity().

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

◆ rossby_front_initialize_temperature_salinity()

subroutine, public rossby_front_2d_initialization::rossby_front_initialize_temperature_salinity ( real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(out)  T,
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(out)  S,
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in)  h,
type(ocean_grid_type), intent(in)  G,
type(verticalgrid_type), intent(in)  GV,
type(param_file_type), intent(in)  param_file,
type(eos_type), pointer  eqn_of_state,
logical, intent(in), optional  just_read_params 
)

Initialization of temperature and salinity in the Rossby front test.

Parameters
[in]gGrid structure
[in]gvThe ocean's vertical grid structure.
[out]tPotential temperature [degC]
[out]sSalinity [ppt]
[in]hThickness [H ~> m or kg m-2]
[in]param_fileParameter file handle
eqn_of_stateEquation of state structure
[in]just_read_paramsIf present and true, this call will only read parameters without changing T & S.

Definition at line 114 of file Rossby_front_2d_initialization.F90.

114  type(ocean_grid_type), intent(in) :: G !< Grid structure
115  type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
116  real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: T !< Potential temperature [degC]
117  real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: S !< Salinity [ppt]
118  real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(in) :: h !< Thickness [H ~> m or kg m-2]
119  type(param_file_type), intent(in) :: param_file !< Parameter file handle
120  type(EOS_type), pointer :: eqn_of_state !< Equation of state structure
121  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
122  !! only read parameters without changing T & S.
123 
124  integer :: i, j, k, is, ie, js, je, nz
125  real :: T_ref, S_ref ! Reference salinity and temerature within surface layer
126  real :: T_range ! Range of salinities and temperatures over the vertical
127  real :: y, zc, zi, dTdz
128  logical :: just_read ! If true, just read parameters but set nothing.
129  character(len=40) :: verticalCoordinate
130  real :: PI ! 3.1415926... calculated as 4*atan(1)
131 
132  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
133 
134  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
135 
136  call get_param(param_file, mdl,"REGRIDDING_COORDINATE_MODE", verticalcoordinate, &
137  default=default_coordinate_mode, do_not_log=just_read)
138  call get_param(param_file, mdl,"S_REF",s_ref,'Reference salinity', units='1e-3', &
139  fail_if_missing=.not.just_read, do_not_log=just_read)
140  call get_param(param_file, mdl,"T_REF",t_ref,'Reference temperature',units='C',&
141  fail_if_missing=.not.just_read, do_not_log=just_read)
142  call get_param(param_file, mdl,"T_RANGE",t_range,'Initial temperature range',&
143  units='C', default=0.0, do_not_log=just_read)
144 
145  if (just_read) return ! All run-time parameters have been read, so return.
146 
147  t(:,:,:) = 0.0
148  s(:,:,:) = s_ref
149  dtdz = t_range / g%max_depth
150 
151  do j = g%jsc,g%jec ; do i = g%isc,g%iec
152  zi = 0.
153  do k = 1, nz
154  zi = zi - h(i,j,k) ! Bottom interface position
155  zc = gv%H_to_Z * (zi - 0.5*h(i,j,k)) ! Position of middle of cell
156  zc = min( zc, -hml(g, g%geoLatT(i,j)) ) ! Bound by depth of mixed layer
157  t(i,j,k) = t_ref + dtdz * zc ! Linear temperature profile
158  enddo
159  enddo ; enddo
160 

References hml(), and mdl.

Here is the call graph for this function:

◆ rossby_front_initialize_thickness()

subroutine, public rossby_front_2d_initialization::rossby_front_initialize_thickness ( real, dimension(szi_(g),szj_(g),szk_(gv)), 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 
)

Initialization of thicknesses in 2D Rossby front test.

Parameters
[in]gGrid structure
[in]gvVertical 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 40 of file Rossby_front_2d_initialization.F90.

40  type(ocean_grid_type), intent(in) :: G !< Grid structure
41  type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure
42  type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
43  real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
44  intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]
45  type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
46  !! to parse for model parameter values.
47  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
48  !! only read parameters without changing h.
49 
50  integer :: i, j, k, is, ie, js, je, nz
51  real :: Tz, Dml, eta, stretch, h0
52  real :: min_thickness, T_range
53  real :: dRho_dT ! The partial derivative of density with temperature [R degC-1 ~> kg m-3 degC-1]
54  logical :: just_read ! If true, just read parameters but set nothing.
55  character(len=40) :: verticalCoordinate
56 
57  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
58 
59  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
60 
61  if (.not.just_read) &
62  call mom_mesg("Rossby_front_2d_initialization.F90, Rossby_front_initialize_thickness: setting thickness")
63 
64  if (.not.just_read) call log_version(param_file, mdl, version, "")
65  ! Read parameters needed to set thickness
66  call get_param(param_file, mdl, "MIN_THICKNESS", min_thickness, &
67  'Minimum layer thickness',units='m',default=1.e-3, do_not_log=just_read)
68  call get_param(param_file, mdl, "REGRIDDING_COORDINATE_MODE", verticalcoordinate, &
69  default=default_coordinate_mode, do_not_log=just_read)
70  call get_param(param_file, mdl, "T_RANGE", t_range, 'Initial temperature range', &
71  units='C', default=0.0, do_not_log=just_read)
72  call get_param(param_file, mdl, "DRHO_DT", drho_dt, default=-0.2, scale=us%kg_m3_to_R, do_not_log=.true.)
73 
74  if (just_read) return ! All run-time parameters have been read, so return.
75 
76  tz = t_range / g%max_depth
77 
78  select case ( coordinatemode(verticalcoordinate) )
79 
80  case (regridding_layer, regridding_rho)
81  do j = g%jsc,g%jec ; do i = g%isc,g%iec
82  dml = hml( g, g%geoLatT(i,j) )
83  eta = -( -drho_dt / gv%Rho0 ) * tz * 0.5 * ( dml * dml )
84  stretch = ( ( g%max_depth + eta ) / g%max_depth )
85  h0 = ( g%max_depth / real(nz) ) * stretch
86  do k = 1, nz
87  h(i,j,k) = h0 * gv%Z_to_H
88  enddo
89  enddo ; enddo
90 
91  case (regridding_zstar, regridding_sigma)
92  do j = g%jsc,g%jec ; do i = g%isc,g%iec
93  dml = hml( g, g%geoLatT(i,j) )
94  eta = -( -drho_dt / gv%Rho0 ) * tz * 0.5 * ( dml * dml )
95  stretch = ( ( g%max_depth + eta ) / g%max_depth )
96  h0 = ( g%max_depth / real(nz) ) * stretch
97  do k = 1, nz
98  h(i,j,k) = h0 * gv%Z_to_H
99  enddo
100  enddo ; enddo
101 
102  case default
103  call mom_error(fatal,"Rossby_front_initialize: "// &
104  "Unrecognized i.c. setup - set REGRIDDING_COORDINATE_MODE")
105 
106  end select
107 

References hml(), mdl, mom_error_handler::mom_error(), mom_error_handler::mom_mesg(), regrid_consts::regridding_rho, and regrid_consts::regridding_sigma.

Here is the call graph for this function:

◆ rossby_front_initialize_velocity()

subroutine, public rossby_front_2d_initialization::rossby_front_initialize_velocity ( real, dimension( g %isdb: g %iedb, g %jsd: g %jed, g %ke), intent(out)  u,
real, dimension( g %isd: g %ied, g %jsdb: g %jedb, g %ke), intent(out)  v,
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in)  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 
)

Initialization of u and v in the Rossby front test.

Parameters
[in]gGrid structure
[in]gvVertical grid structure
[out]ui-component of velocity [L T-1 ~> m s-1]
[out]vj-component of velocity [L T-1 ~> m s-1]
[in]hThickness [H ~> m or kg m-2]
[in]usA dimensional unit scaling type
[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 setting u & v.

Definition at line 166 of file Rossby_front_2d_initialization.F90.

166  type(ocean_grid_type), intent(in) :: G !< Grid structure
167  type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure
168  real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
169  intent(out) :: u !< i-component of velocity [L T-1 ~> m s-1]
170  real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
171  intent(out) :: v !< j-component of velocity [L T-1 ~> m s-1]
172  real, dimension(SZI_(G),SZJ_(G), SZK_(G)), &
173  intent(in) :: h !< Thickness [H ~> m or kg m-2]
174  type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
175  type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
176  !! to parse for model parameter values.
177  logical, optional, intent(in) :: just_read_params !< If present and true, this call
178  !! will only read parameters without setting u & v.
179 
180  real :: y ! Non-dimensional coordinate across channel, 0..pi
181  real :: T_range ! Range of salinities and temperatures over the vertical
182  real :: dUdT ! Factor to convert dT/dy into dU/dz, g*alpha/f [L2 Z-1 T-1 degC-1 ~> m s-1 degC-1]
183  real :: dRho_dT ! The partial derivative of density with temperature [R degC-1 ~> kg m-3 degC-1]
184  real :: Dml, zi, zc, zm ! Depths [Z ~> m].
185  real :: f ! The local Coriolis parameter [T-1 ~> s-1]
186  real :: Ty ! The meridional temperature gradient [degC L-1 ~> degC m-1]
187  real :: hAtU ! Interpolated layer thickness [Z ~> m].
188  integer :: i, j, k, is, ie, js, je, nz
189  logical :: just_read ! If true, just read parameters but set nothing.
190  character(len=40) :: verticalCoordinate
191 
192  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
193 
194  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
195 
196  call get_param(param_file, mdl, "REGRIDDING_COORDINATE_MODE", verticalcoordinate, &
197  default=default_coordinate_mode, do_not_log=just_read)
198  call get_param(param_file, mdl, "T_RANGE", t_range, 'Initial temperature range', &
199  units='C', default=0.0, do_not_log=just_read)
200  call get_param(param_file, mdl, "DRHO_DT", drho_dt, default=-0.2, scale=us%kg_m3_to_R, do_not_log=.true.)
201 
202  if (just_read) return ! All run-time parameters have been read, so return.
203 
204  v(:,:,:) = 0.0
205  u(:,:,:) = 0.0
206 
207  do j = g%jsc,g%jec ; do i = g%isc-1,g%iec+1
208  f = 0.5* (g%CoriolisBu(i,j) + g%CoriolisBu(i,j-1) )
209  dudt = 0.0 ; if (abs(f) > 0.0) &
210  dudt = ( gv%g_Earth*drho_dt ) / ( f * gv%Rho0 )
211  dml = hml( g, g%geoLatT(i,j) )
212  ty = us%L_to_m*dtdy( g, t_range, g%geoLatT(i,j) )
213  zi = 0.
214  do k = 1, nz
215  hatu = 0.5*(h(i,j,k)+h(i+1,j,k)) * gv%H_to_Z
216  zi = zi - hatu ! Bottom interface position
217  zc = zi - 0.5*hatu ! Position of middle of cell
218  zm = max( zc + dml, 0. ) ! Height above bottom of mixed layer
219  u(i,j,k) = dudt * ty * zm ! Thermal wind starting at base of ML
220  enddo
221  enddo ; enddo
222 

References dtdy(), hml(), and mdl.

Referenced by mom_state_initialization::mom_initialize_state().

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

◆ ypseudo()

real function rossby_front_2d_initialization::ypseudo ( type(ocean_grid_type), intent(in)  G,
real, intent(in)  lat 
)
private

Pseudo coordinate across domain used by Hml() and dTdy() returns a coordinate from -PI/2 .. PI/2 squashed towards the center of the domain.

Parameters
[in]gGrid structure
[in]latLatitude

Definition at line 229 of file Rossby_front_2d_initialization.F90.

229  type(ocean_grid_type), intent(in) :: G !< Grid structure
230  real, intent(in) :: lat !< Latitude
231  ! Local
232  real :: y, PI
233 
234  pi = 4.0 * atan(1.0)
235  ypseudo = ( ( lat - g%south_lat ) / g%len_lat ) - 0.5 ! -1/2 .. 1/.2
236  ypseudo = pi * max(-0.5, min(0.5, ypseudo / frontfractionalwidth))

References frontfractionalwidth.

Referenced by dtdy(), and hml().

Here is the caller graph for this function:

Variable Documentation

◆ frontfractionalwidth

real, parameter rossby_front_2d_initialization::frontfractionalwidth = 0.5
private

Width of front as fraction of domain [nondim].

Definition at line 32 of file Rossby_front_2d_initialization.F90.

32 real, parameter :: frontFractionalWidth = 0.5 !< Width of front as fraction of domain [nondim]

Referenced by dtdy(), and ypseudo().

◆ hmlmax

real, parameter rossby_front_2d_initialization::hmlmax = 0.75
private

Deepest ML as fractional depth of ocean [nondim].

Definition at line 34 of file Rossby_front_2d_initialization.F90.

34 real, parameter :: HMLmax = 0.75 !< Deepest ML as fractional depth of ocean [nondim]

Referenced by dtdy(), and hml().

◆ hmlmin

real, parameter rossby_front_2d_initialization::hmlmin = 0.25
private

Shallowest ML as fractional depth of ocean [nondim].

Definition at line 33 of file Rossby_front_2d_initialization.F90.

33 real, parameter :: HMLmin = 0.25 !< Shallowest ML as fractional depth of ocean [nondim]

Referenced by dtdy(), and hml().

◆ mdl

character(len=40) rossby_front_2d_initialization::mdl = "Rossby_front_2d_initialization"
private

This module's name.

Definition at line 23 of file Rossby_front_2d_initialization.F90.

23 character(len=40) :: mdl = "Rossby_front_2d_initialization" !< This module's name.

Referenced by rossby_front_initialize_temperature_salinity(), rossby_front_initialize_thickness(), and rossby_front_initialize_velocity().