MOM6
user_initialization Module Reference

Detailed Description

By Robert Hallberg, April 1994 - June 2002 *

  • This subroutine initializes the fields for the simulations. * The one argument passed to initialize, Time, is set to the * current time of the simulation. The fields which are initialized * here are: * u - Zonal velocity in m s-1. * v - Meridional velocity in m s-1. * h - Layer thickness in m. (Must be positive.) * GbathyT - Basin depth in m. (Must be positive.) * GCoriolisBu - The Coriolis parameter, in s-1. * GVg_prime - The reduced gravity at each interface, in m s-2. * GVRlay - Layer potential density (coordinate variable), kg m-3. * If ENABLE_THERMODYNAMICS is defined: * T - Temperature in C. * S - Salinity in psu. * If BULKMIXEDLAYER is defined: * Rml - Mixed layer and buffer layer potential densities in * units of kg m-3. * If SPONGE is defined: * A series of subroutine calls are made to set up the damping * rates and reference profiles for all variables that are damped * in the sponge. * Any user provided tracer code is also first linked through this * subroutine. *
  • Forcing-related fields (taux, tauy, buoy, ustar, etc.) are set * in MOM_surface_forcing.F90. *
  • These variables are all set in the set of subroutines (in this * file) USER_initialize_bottom_depth, USER_initialize_thickness, * USER_initialize_velocity, USER_initialize_temperature_salinity, * USER_initialize_mixed_layer_density, USER_initialize_sponges, * USER_set_coord, and USER_set_ref_profile. *
  • The names of these subroutines should be self-explanatory. They * start with "USER_" to indicate that they will likely have to be * modified for each simulation to set the initial conditions and * boundary conditions. Most of these take two arguments: an integer * argument specifying whether the fields are to be calculated * internally or read from a NetCDF file; and a string giving the * path to that file. If the field is initialized internally, the * path is ignored. *
  • Macros written all in capital letters are defined in MOM_memory.h. *
  • A small fragment of the grid is shown below: *
  • j+1 x ^ x ^ x At x: q, CoriolisBu * j+1 > o > o > At ^: v, tauy * j x ^ x ^ x At >: u, taux * j > o > o > At o: h, bathyT, buoy, tr, T, S, Rml, ustar * j-1 x ^ x ^ x * i-1 i i+1 At x & ^: * i i+1 At > & o: *
  • The boundaries always run through q grid points (x). *.

Functions/Subroutines

subroutine, public user_set_coord (Rlay, g_prime, GV, param_file, eqn_of_state)
 Set vertical coordinates. More...
 
subroutine, public user_initialize_topography (D, G, param_file, max_depth)
 Initialize topography. More...
 
subroutine, public user_initialize_thickness (h, G, param_file, T, just_read_params)
 initialize thicknesses. More...
 
subroutine, public user_initialize_velocity (u, v, G, param_file, just_read_params)
 initialize velocities. More...
 
subroutine, public user_init_temperature_salinity (T, S, G, param_file, eqn_of_state, just_read_params)
 This function puts the initial layer temperatures and salinities into T(:,:,:) and S(:,:,:). More...
 
subroutine, public user_initialize_sponges (G, use_temperature, tv, param_file, CSp, h)
 Set up the sponges. More...
 
subroutine, public user_set_obc_data (OBC, tv, G, param_file, tr_Reg)
 This subroutine sets the properties of flow at open boundary conditions. More...
 
subroutine, public user_set_rotation (G, param_file)
 
subroutine write_user_log (param_file)
 Write output about the parameter values being used. More...
 

Variables

logical first_call = .true.
 

Function/Subroutine Documentation

◆ user_init_temperature_salinity()

subroutine, public user_initialization::user_init_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,
type(ocean_grid_type), intent(in)  G,
type(param_file_type), intent(in)  param_file,
type(eos_type), pointer  eqn_of_state,
logical, intent(in), optional  just_read_params 
)

This function puts the initial layer temperatures and salinities into T(:,:,:) and S(:,:,:).

Parameters
[in]gOcean grid structure.
[out]tPotential temperature (degC).
[out]sSalinity (ppt).
[in]param_fileA structure indicating the open file to parse for model parameter values.
eqn_of_stateInteger that selects the equation of state.
[in]just_read_paramsIf present and true, this call will only read parameters without changing h.

Definition at line 150 of file user_initialization.F90.

References first_call, mom_error_handler::mom_error(), and write_user_log().

150  type(ocean_grid_type), intent(in) :: g !< Ocean grid structure.
151  real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: t !< Potential temperature (degC).
152  real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: s !< Salinity (ppt).
153  type(param_file_type), intent(in) :: param_file !< A structure indicating the
154  !! open file to parse for model
155  !! parameter values.
156  type(eos_type), pointer :: eqn_of_state !< Integer that selects the
157  !! equation of state.
158  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
159  !! only read parameters without changing h.
160 
161  logical :: just_read ! If true, just read parameters but set nothing.
162 
163  call mom_error(fatal, &
164  "USER_initialization.F90, USER_init_temperature_salinity: " // &
165  "Unmodified user routine called - you must edit the routine to use it")
166 
167  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
168 
169  if (just_read) return ! All run-time parameters have been read, so return.
170 
171  t(:,:,1) = 0.0
172  s(:,:,1) = 0.0
173 
174  if (first_call) call write_user_log(param_file)
175 
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:19
Here is the call graph for this function:

◆ user_initialize_sponges()

subroutine, public user_initialization::user_initialize_sponges ( type(ocean_grid_type), intent(in)  G,
logical, intent(in)  use_temperature,
type(thermo_var_ptrs), intent(in)  tv,
type(param_file_type), intent(in)  param_file,
type(sponge_cs), pointer  CSp,
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in)  h 
)

Set up the sponges.

Parameters
[in]gOcean grid structure.
[in]use_temperatureWhether to use potential temperature.
[in]tvA structure containing pointers to any available thermodynamic fields, potential temperature and salinity or mixed layer density. Absent fields have NULL ptrs.
[in]param_fileA structure indicating the open file to parse for model parameter values.
cspA pointer to the sponge control structure.
[in]hLayer thicknesses.

Definition at line 180 of file user_initialization.F90.

References first_call, mom_error_handler::mom_error(), and write_user_log().

Referenced by mom_state_initialization::mom_initialize_state().

180  type(ocean_grid_type), intent(in) :: g !< Ocean grid structure.
181  logical, intent(in) :: use_temperature !< Whether to use potential
182  !! temperature.
183  type(thermo_var_ptrs), intent(in) :: tv !< A structure containing pointers
184  !! to any available thermodynamic
185  !! fields, potential temperature and
186  !! salinity or mixed layer density.
187  !! Absent fields have NULL ptrs.
188  type(param_file_type), intent(in) :: param_file !< A structure indicating the
189  !! open file to parse for model
190  !! parameter values.
191  type(sponge_cs), pointer :: csp !< A pointer to the sponge control
192  !! structure.
193  real, dimension(SZI_(G), SZJ_(G), SZK_(G)), intent(in) :: h !< Layer thicknesses.
194  call mom_error(fatal, &
195  "USER_initialization.F90, USER_initialize_sponges: " // &
196  "Unmodified user routine called - you must edit the routine to use it")
197 
198  if (first_call) call write_user_log(param_file)
199 
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:19
Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_initialize_thickness()

subroutine, public user_initialization::user_initialize_thickness ( real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(out)  h,
type(ocean_grid_type), intent(in)  G,
type(param_file_type), intent(in)  param_file,
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in)  T,
logical, intent(in), optional  just_read_params 
)

initialize thicknesses.

Parameters
[in]gThe ocean's grid structure.
[out]hThe thicknesses being initialized.
[in]param_fileA structure indicating the open file to parse for model parameter values.
[in]tPotential temperature.
[in]just_read_paramsIf present and true, this call will only read parameters without changing h.

Definition at line 93 of file user_initialization.F90.

References first_call, mom_error_handler::mom_error(), and write_user_log().

93  type(ocean_grid_type), intent(in) :: g !< The ocean's grid structure.
94  real, intent(out), dimension(SZI_(G),SZJ_(G),SZK_(G)) :: h !< The thicknesses being
95  !! initialized.
96  type(param_file_type), intent(in) :: param_file !< A structure indicating the
97  !! open file to parse for model
98  !! parameter values.
99  real, intent(in), dimension(SZI_(G),SZJ_(G), SZK_(G)) :: t !< Potential temperature.
100  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
101  !! only read parameters without changing h.
102 
103  logical :: just_read ! If true, just read parameters but set nothing.
104 
105  call mom_error(fatal, &
106  "USER_initialization.F90, USER_initialize_thickness: " // &
107  "Unmodified user routine called - you must edit the routine to use it")
108 
109  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
110 
111  if (just_read) return ! All run-time parameters have been read, so return.
112 
113  h(:,:,1) = 0.0
114 
115  if (first_call) call write_user_log(param_file)
116 
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:19
Here is the call graph for this function:

◆ user_initialize_topography()

subroutine, public user_initialization::user_initialize_topography ( real, dimension(g%isd:g%ied,g%jsd:g%jed), intent(out)  D,
type(dyn_horgrid_type), intent(in)  G,
type(param_file_type), intent(in)  param_file,
real, intent(in)  max_depth 
)

Initialize topography.

Parameters
[in]gThe dynamic horizontal grid type
[out]dOcean bottom depth in m
[in]param_fileParameter file structure
[in]max_depthMaximum depth of model in m

Definition at line 75 of file user_initialization.F90.

References first_call, mom_error_handler::mom_error(), and write_user_log().

Referenced by mom_fixed_initialization::mom_initialize_topography().

75  type(dyn_horgrid_type), intent(in) :: g !< The dynamic horizontal grid type
76  real, dimension(G%isd:G%ied,G%jsd:G%jed), &
77  intent(out) :: d !< Ocean bottom depth in m
78  type(param_file_type), intent(in) :: param_file !< Parameter file structure
79  real, intent(in) :: max_depth !< Maximum depth of model in m
80 
81  call mom_error(fatal, &
82  "USER_initialization.F90, USER_initialize_topography: " // &
83  "Unmodified user routine called - you must edit the routine to use it")
84 
85  d(:,:) = 0.0
86 
87  if (first_call) call write_user_log(param_file)
88 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_initialize_velocity()

subroutine, public user_initialization::user_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,
type(ocean_grid_type), intent(in)  G,
type(param_file_type), intent(in)  param_file,
logical, intent(in), optional  just_read_params 
)

initialize velocities.

Parameters
[in]gOcean grid structure.
[out]ui-component of velocity [m/s]
[out]vj-component of velocity [m/s]
[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 121 of file user_initialization.F90.

References first_call, mom_error_handler::mom_error(), and write_user_log().

121  type(ocean_grid_type), intent(in) :: g !< Ocean grid structure.
122  real, dimension(SZIB_(G), SZJ_(G), SZK_(G)), intent(out) :: u !< i-component of velocity [m/s]
123  real, dimension(SZI_(G), SZJB_(G), SZK_(G)), intent(out) :: v !< j-component of velocity [m/s]
124  type(param_file_type), intent(in) :: param_file !< A structure indicating the
125  !! open file to parse for model
126  !! parameter values.
127  logical, optional, intent(in) :: just_read_params !< If present and true, this call will
128  !! only read parameters without changing h.
129 
130  logical :: just_read ! If true, just read parameters but set nothing.
131 
132  call mom_error(fatal, &
133  "USER_initialization.F90, USER_initialize_velocity: " // &
134  "Unmodified user routine called - you must edit the routine to use it")
135 
136  just_read = .false. ; if (present(just_read_params)) just_read = just_read_params
137 
138  if (just_read) return ! All run-time parameters have been read, so return.
139 
140  u(:,:,1) = 0.0
141  v(:,:,1) = 0.0
142 
143  if (first_call) call write_user_log(param_file)
144 
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:19
Here is the call graph for this function:

◆ user_set_coord()

subroutine, public user_initialization::user_set_coord ( real, dimension(:), intent(out)  Rlay,
real, dimension(:), intent(out)  g_prime,
type(verticalgrid_type), intent(in)  GV,
type(param_file_type), intent(in)  param_file,
type(eos_type), pointer  eqn_of_state 
)

Set vertical coordinates.

Parameters
[in]gvThe ocean's vertical grid structure.
[out]rlayLayer potential density.
[out]g_primeThe reduced gravity at each interface, in m s-2.
[in]param_fileA structure indicating the open file to parse for model parameter values.
eqn_of_stateInteger that selects the equation of state.

Definition at line 52 of file user_initialization.F90.

References first_call, mom_error_handler::mom_error(), and write_user_log().

Referenced by mom_coord_initialization::mom_initialize_coord().

52  type(verticalgrid_type), intent(in) :: gv !< The ocean's vertical grid
53  !! structure.
54  real, dimension(:), intent(out) :: rlay !< Layer potential density.
55  real, dimension(:), intent(out) :: g_prime !< The reduced gravity at
56  !! each interface, in m s-2.
57  type(param_file_type), intent(in) :: param_file !< A structure indicating the
58  !! open file to parse for model
59  !! parameter values.
60  type(eos_type), pointer :: eqn_of_state !< Integer that selects the
61  !! equation of state.
62 
63  call mom_error(fatal, &
64  "USER_initialization.F90, USER_set_coord: " // &
65  "Unmodified user routine called - you must edit the routine to use it")
66  rlay(:) = 0.0
67  g_prime(:) = 0.0
68 
69  if (first_call) call write_user_log(param_file)
70 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ user_set_obc_data()

subroutine, public user_initialization::user_set_obc_data ( type(ocean_obc_type), pointer  OBC,
type(thermo_var_ptrs), intent(in)  tv,
type(ocean_grid_type), intent(in)  G,
type(param_file_type), intent(in)  param_file,
type(tracer_registry_type), pointer  tr_Reg 
)

This subroutine sets the properties of flow at open boundary conditions.

Parameters
obcThis open boundary condition type specifies whether, where, and what open boundary conditions are used.
[in]tvA structure containing pointers to any available thermodynamic fields, including potential temperature and salinity or mixed layer density. Absent fields have NULL ptrs.
[in]gThe ocean's grid structure.
[in]param_fileA structure indicating the open file to parse for model parameter values.
tr_regTracer registry.

Definition at line 204 of file user_initialization.F90.

References first_call, and write_user_log().

204  type(ocean_obc_type), pointer :: obc !< This open boundary condition type specifies
205  !! whether, where, and what open boundary
206  !! conditions are used.
207  type(thermo_var_ptrs), intent(in) :: tv !< A structure containing pointers to any
208  !! available thermodynamic fields, including potential
209  !! temperature and salinity or mixed layer density. Absent
210  !! fields have NULL ptrs.
211  type(ocean_grid_type), intent(in) :: g !< The ocean's grid structure.
212  type(param_file_type), intent(in) :: param_file !< A structure indicating the
213  !! open file to parse for model
214  !! parameter values.
215  type(tracer_registry_type), pointer :: tr_reg !< Tracer registry.
216 ! call MOM_error(FATAL, &
217 ! "USER_initialization.F90, USER_set_OBC_data: " // &
218 ! "Unmodified user routine called - you must edit the routine to use it")
219 
220  if (first_call) call write_user_log(param_file)
221 
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:19
Here is the call graph for this function:

◆ user_set_rotation()

subroutine, public user_initialization::user_set_rotation ( type(ocean_grid_type), intent(inout)  G,
type(param_file_type), intent(in)  param_file 
)
Parameters
[in,out]gThe ocean's grid structure
[in]param_fileA structure to parse for run-time parameters

Definition at line 225 of file user_initialization.F90.

References first_call, mom_error_handler::mom_error(), and write_user_log().

225  type(ocean_grid_type), intent(inout) :: g !< The ocean's grid structure
226  type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters
227  call mom_error(fatal, &
228  "USER_initialization.F90, USER_set_rotation: " // &
229  "Unmodified user routine called - you must edit the routine to use it")
230 
231  if (first_call) call write_user_log(param_file)
232 
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:19
Here is the call graph for this function:

◆ write_user_log()

subroutine user_initialization::write_user_log ( type(param_file_type), intent(in)  param_file)
private

Write output about the parameter values being used.

Parameters
[in]param_fileA structure indicating the open file to parse for model parameter values.

Definition at line 237 of file user_initialization.F90.

References first_call.

Referenced by user_init_temperature_salinity(), user_initialize_sponges(), user_initialize_thickness(), user_initialize_topography(), user_initialize_velocity(), user_set_coord(), user_set_obc_data(), and user_set_rotation().

237  type(param_file_type), intent(in) :: param_file !< A structure indicating the
238  !! open file to parse for model
239  !! parameter values.
240 
241 ! This include declares and sets the variable "version".
242 #include "version_variable.h"
243  character(len=40) :: mdl = "user_initialization" ! This module's name.
244 
245  call log_version(param_file, mdl, version)
246  first_call = .false.
247 
Here is the caller graph for this function:

Variable Documentation

◆ first_call

logical user_initialization::first_call = .true.
private