MOM6
mom_fixed_initialization Module Reference

Detailed Description

Initializes fixed aspects of the model, such as horizontal grid metrics, topography and Coriolis.

Functions/Subroutines

subroutine, public mom_initialize_fixed (G, US, OBC, PF, write_geom, output_dir)
 MOM_initialize_fixed sets up time-invariant quantities related to MOM6's horizontal grid, bathymetry, and the Coriolis parameter. More...
 
subroutine, public mom_initialize_topography (D, max_depth, G, PF, US)
 MOM_initialize_topography makes the appropriate call to set up the bathymetry. At this point the topography is in units of [m], but this can be changed later. More...
 

Function/Subroutine Documentation

◆ mom_initialize_fixed()

subroutine, public mom_fixed_initialization::mom_initialize_fixed ( type(dyn_horgrid_type), intent(inout)  G,
type(unit_scale_type), intent(in)  US,
type(ocean_obc_type), pointer  OBC,
type(param_file_type), intent(in)  PF,
logical, intent(in)  write_geom,
character(len=*), intent(in)  output_dir 
)

MOM_initialize_fixed sets up time-invariant quantities related to MOM6's horizontal grid, bathymetry, and the Coriolis parameter.

Parameters
[in,out]gThe ocean's grid structure.
[in]usA dimensional unit scaling type
obcOpen boundary structure.
[in]pfA structure indicating the open file to parse for model parameter values.
[in]write_geomIf true, write grid geometry files.
[in]output_dirThe directory into which to write files.

Definition at line 57 of file MOM_fixed_initialization.F90.

57  type(dyn_horgrid_type), intent(inout) :: G !< The ocean's grid structure.
58  type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
59  type(ocean_OBC_type), pointer :: OBC !< Open boundary structure.
60  type(param_file_type), intent(in) :: PF !< A structure indicating the open file
61  !! to parse for model parameter values.
62  logical, intent(in) :: write_geom !< If true, write grid geometry files.
63  character(len=*), intent(in) :: output_dir !< The directory into which to write files.
64 
65  ! Local
66  character(len=200) :: inputdir ! The directory where NetCDF input files are.
67  character(len=200) :: config
68  character(len=40) :: mdl = "MOM_fixed_initialization" ! This module's name.
69  logical :: debug
70 ! This include declares and sets the variable "version".
71 #include "version_variable.h"
72 
73  call calltree_enter("MOM_initialize_fixed(), MOM_fixed_initialization.F90")
74  call log_version(pf, mdl, version, "")
75  call get_param(pf, mdl, "DEBUG", debug, default=.false.)
76 
77  call get_param(pf, mdl, "INPUTDIR", inputdir, &
78  "The directory in which input files are found.", default=".")
79  inputdir = slasher(inputdir)
80 
81  ! Set up the parameters of the physical domain (i.e. the grid), G
82  call set_grid_metrics(g, pf, us)
83 
84  ! Set up the bottom depth, G%bathyT either analytically or from file
85  ! This also sets G%max_depth based on the input parameter MAXIMUM_DEPTH,
86  ! or, if absent, is diagnosed as G%max_depth = max( G%D(:,:) )
87  call mom_initialize_topography(g%bathyT, g%max_depth, g, pf, us)
88 ! call rescale_dyn_horgrid_bathymetry(G, US%Z_to_m)
89 
90  ! To initialize masks, the bathymetry in halo regions must be filled in
91  call pass_var(g%bathyT, g%Domain)
92 
93  ! Determine the position of any open boundaries
94  call open_boundary_config(g, us, pf, obc)
95 
96  ! Make bathymetry consistent with open boundaries
97  call open_boundary_impose_normal_slope(obc, g, g%bathyT)
98 
99  ! This call sets masks that prohibit flow over any point interpreted as land
100  call initialize_masks(g, pf, us)
101 
102  ! Make OBC mask consistent with land mask
103  call open_boundary_impose_land_mask(obc, g, g%areaCu, g%areaCv, us)
104 
105  if (debug) then
106  call hchksum(g%bathyT, 'MOM_initialize_fixed: depth ', g%HI, haloshift=1, scale=us%Z_to_m)
107  call hchksum(g%mask2dT, 'MOM_initialize_fixed: mask2dT ', g%HI)
108  call uvchksum('MOM_initialize_fixed: mask2dC[uv]', g%mask2dCu, &
109  g%mask2dCv, g%HI)
110  call qchksum(g%mask2dBu, 'MOM_initialize_fixed: mask2dBu ', g%HI)
111  endif
112 
113  ! Modulate geometric scales according to geography.
114  call get_param(pf, mdl, "CHANNEL_CONFIG", config, &
115  "A parameter that determines which set of channels are \n"//&
116  "restricted to specific widths. Options are:\n"//&
117  " \t none - All channels have the grid width.\n"//&
118  " \t global_1deg - Sets 16 specific channels appropriate \n"//&
119  " \t\t for a 1-degree model, as used in CM2G.\n"//&
120  " \t list - Read the channel locations and widths from a \n"//&
121  " \t\t text file, like MOM_channel_list in the MOM_SIS \n"//&
122  " \t\t test case.\n"//&
123  " \t file - Read open face widths everywhere from a \n"//&
124  " \t\t NetCDF file on the model grid.", &
125  default="none")
126  select case ( trim(config) )
127  case ("none")
128  case ("list") ; call reset_face_lengths_list(g, pf, us)
129  case ("file") ; call reset_face_lengths_file(g, pf, us)
130  case ("global_1deg") ; call reset_face_lengths_named(g, pf, trim(config), us)
131  case default ; call mom_error(fatal, "MOM_initialize_fixed: "// &
132  "Unrecognized channel configuration "//trim(config))
133  end select
134 
135  ! This call sets the topography at velocity points.
136  if (g%bathymetry_at_vel) then
137  call get_param(pf, mdl, "VELOCITY_DEPTH_CONFIG", config, &
138  "A string that determines how the topography is set at "//&
139  "velocity points. This may be 'min' or 'max'.", &
140  default="max")
141  select case ( trim(config) )
142  case ("max") ; call set_velocity_depth_max(g)
143  case ("min") ; call set_velocity_depth_min(g)
144  case default ; call mom_error(fatal, "MOM_initialize_fixed: "// &
145  "Unrecognized velocity depth configuration "//trim(config))
146  end select
147  endif
148 
149 ! Calculate the value of the Coriolis parameter at the latitude !
150 ! of the q grid points [s-1].
151  call mom_initialize_rotation(g%CoriolisBu, g, pf, us=us)
152 ! Calculate the components of grad f (beta)
153  call mom_calculate_grad_coriolis(g%dF_dx, g%dF_dy, g, us=us)
154  if (debug) then
155  call qchksum(g%CoriolisBu, "MOM_initialize_fixed: f ", g%HI, scale=us%s_to_T)
156  call hchksum(g%dF_dx, "MOM_initialize_fixed: dF_dx ", g%HI, scale=us%m_to_L*us%s_to_T)
157  call hchksum(g%dF_dy, "MOM_initialize_fixed: dF_dy ", g%HI, scale=us%m_to_L*us%s_to_T)
158  endif
159 
160  call initialize_grid_rotation_angle(g, pf)
161 
162 ! Compute global integrals of grid values for later use in scalar diagnostics !
163  call compute_global_grid_integrals(g, us=us)
164 
165 ! Write out all of the grid data used by this run.
166  if (write_geom) call write_ocean_geometry_file(g, pf, output_dir, us=us)
167 
168  call calltree_leave('MOM_initialize_fixed()')
169 

◆ mom_initialize_topography()

subroutine, public mom_fixed_initialization::mom_initialize_topography ( real, dimension(g%isd:g%ied,g%jsd:g%jed), intent(out)  D,
real, intent(out)  max_depth,
type(dyn_horgrid_type), intent(in)  G,
type(param_file_type), intent(in)  PF,
type(unit_scale_type), intent(in), optional  US 
)

MOM_initialize_topography makes the appropriate call to set up the bathymetry. At this point the topography is in units of [m], but this can be changed later.

Parameters
[in]gThe dynamic horizontal grid type
[out]dOcean bottom depth [m]
[in]pfParameter file structure
[out]max_depthMaximum depth of model [m]
[in]usA dimensional unit scaling type

Definition at line 175 of file MOM_fixed_initialization.F90.

175  type(dyn_horgrid_type), intent(in) :: G !< The dynamic horizontal grid type
176  real, dimension(G%isd:G%ied,G%jsd:G%jed), &
177  intent(out) :: D !< Ocean bottom depth [m]
178  type(param_file_type), intent(in) :: PF !< Parameter file structure
179  real, intent(out) :: max_depth !< Maximum depth of model [m]
180  type(unit_scale_type), optional, intent(in) :: US !< A dimensional unit scaling type
181 
182  ! This subroutine makes the appropriate call to set up the bottom depth.
183  ! This is a separate subroutine so that it can be made public and shared with
184  ! the ice-sheet code or other components.
185 
186  ! Local variables
187  real :: m_to_Z, Z_to_m ! Dimensional rescaling factors
188  character(len=40) :: mdl = "MOM_initialize_topography" ! This subroutine's name.
189  character(len=200) :: config
190 
191  m_to_z = 1.0 ; if (present(us)) m_to_z = us%m_to_Z
192  z_to_m = 1.0 ; if (present(us)) z_to_m = us%Z_to_m
193 
194  call get_param(pf, mdl, "TOPO_CONFIG", config, &
195  "This specifies how bathymetry is specified: \n"//&
196  " \t file - read bathymetric information from the file \n"//&
197  " \t\t specified by (TOPO_FILE).\n"//&
198  " \t flat - flat bottom set to MAXIMUM_DEPTH. \n"//&
199  " \t bowl - an analytically specified bowl-shaped basin \n"//&
200  " \t\t ranging between MAXIMUM_DEPTH and MINIMUM_DEPTH. \n"//&
201  " \t spoon - a similar shape to 'bowl', but with an vertical \n"//&
202  " \t\t wall at the southern face. \n"//&
203  " \t halfpipe - a zonally uniform channel with a half-sine \n"//&
204  " \t\t profile in the meridional direction. \n"//&
205  " \t bbuilder - build topography from list of functions. \n"//&
206  " \t benchmark - use the benchmark test case topography. \n"//&
207  " \t Neverworld - use the Neverworld test case topography. \n"//&
208  " \t DOME - use a slope and channel configuration for the \n"//&
209  " \t\t DOME sill-overflow test case. \n"//&
210  " \t ISOMIP - use a slope and channel configuration for the \n"//&
211  " \t\t ISOMIP test case. \n"//&
212  " \t DOME2D - use a shelf and slope configuration for the \n"//&
213  " \t\t DOME2D gravity current/overflow test case. \n"//&
214  " \t Kelvin - flat but with rotated land mask.\n"//&
215  " \t seamount - Gaussian bump for spontaneous motion test case.\n"//&
216  " \t dumbbell - Sloshing channel with reservoirs on both ends.\n"//&
217  " \t shelfwave - exponential slope for shelfwave test case.\n"//&
218  " \t Phillips - ACC-like idealized topography used in the Phillips config.\n"//&
219  " \t dense - Denmark Strait-like dense water formation and overflow.\n"//&
220  " \t USER - call a user modified routine.", &
221  fail_if_missing=.true.)
222  max_depth = -1.e9*m_to_z ; call read_param(pf, "MAXIMUM_DEPTH", max_depth, scale=m_to_z)
223  select case ( trim(config) )
224  case ("file"); call initialize_topography_from_file(d, g, pf, us)
225  case ("flat"); call initialize_topography_named(d, g, pf, config, max_depth, us)
226  case ("spoon"); call initialize_topography_named(d, g, pf, config, max_depth, us)
227  case ("bowl"); call initialize_topography_named(d, g, pf, config, max_depth, us)
228  case ("halfpipe"); call initialize_topography_named(d, g, pf, config, max_depth, us)
229  case ("DOME"); call dome_initialize_topography(d, g, pf, max_depth, us)
230  case ("ISOMIP"); call isomip_initialize_topography(d, g, pf, max_depth, us)
231  case ("bbuilder"); call basin_builder_topography(d, g, pf, max_depth)
232  case ("benchmark"); call benchmark_initialize_topography(d, g, pf, max_depth, us)
233  case ("Neverworld","Neverland"); call neverworld_initialize_topography(d, g, pf, max_depth)
234  case ("DOME2D"); call dome2d_initialize_topography(d, g, pf, max_depth)
235  case ("Kelvin"); call kelvin_initialize_topography(d, g, pf, max_depth, us)
236  case ("sloshing"); call sloshing_initialize_topography(d, g, pf, max_depth)
237  case ("seamount"); call seamount_initialize_topography(d, g, pf, max_depth)
238  case ("dumbbell"); call dumbbell_initialize_topography(d, g, pf, max_depth)
239  case ("shelfwave"); call shelfwave_initialize_topography(d, g, pf, max_depth, us)
240  case ("Phillips"); call phillips_initialize_topography(d, g, pf, max_depth, us)
241  case ("dense"); call dense_water_initialize_topography(d, g, pf, max_depth)
242  case ("USER"); call user_initialize_topography(d, g, pf, max_depth, us)
243  case default ; call mom_error(fatal,"MOM_initialize_topography: "// &
244  "Unrecognized topography setup '"//trim(config)//"'")
245  end select
246  if (max_depth>0.) then
247  call log_param(pf, mdl, "MAXIMUM_DEPTH", max_depth*z_to_m, &
248  "The maximum depth of the ocean.", units="m")
249  else
250  max_depth = diagnosemaximumdepth(d,g)
251  call log_param(pf, mdl, "!MAXIMUM_DEPTH", max_depth*z_to_m, &
252  "The (diagnosed) maximum depth of the ocean.", units="m", like_default=.true.)
253  endif
254  if (trim(config) /= "DOME") then
255  call limit_topography(d, g, pf, max_depth, us)
256  endif
257