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, 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)
 MOM_initialize_topography makes the appropriate call to set up the bathymetry. More...
 

Function/Subroutine Documentation

◆ mom_initialize_fixed()

subroutine, public mom_fixed_initialization::mom_initialize_fixed ( type(dyn_horgrid_type), intent(inout)  G,
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.
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 54 of file MOM_fixed_initialization.F90.

References mom_error_handler::calltree_enter(), mom_error_handler::calltree_leave(), mom_shared_initialization::compute_global_grid_integrals(), mom_grid_initialize::initialize_masks(), mom_initialize_topography(), mom_open_boundary::open_boundary_impose_land_mask(), mom_grid_initialize::set_grid_metrics(), and mom_shared_initialization::write_ocean_geometry_file().

Referenced by mom::initialize_mom().

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

◆ 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 
)

MOM_initialize_topography makes the appropriate call to set up the bathymetry.

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

Definition at line 169 of file MOM_fixed_initialization.F90.

References benchmark_initialization::benchmark_initialize_topography(), dense_water_initialization::dense_water_initialize_topography(), dome2d_initialization::dome2d_initialize_topography(), dome_initialization::dome_initialize_topography(), isomip_initialization::isomip_initialize_topography(), kelvin_initialization::kelvin_initialize_topography(), phillips_initialization::phillips_initialize_topography(), seamount_initialization::seamount_initialize_topography(), shelfwave_initialization::shelfwave_initialize_topography(), sloshing_initialization::sloshing_initialize_topography(), supercritical_initialization::supercritical_initialize_topography(), and user_initialization::user_initialize_topography().

Referenced by mom_initialize_fixed().

169  type(dyn_horgrid_type), intent(in) :: g !< The dynamic horizontal grid type
170  real, dimension(G%isd:G%ied,G%jsd:G%jed), &
171  intent(out) :: d !< Ocean bottom depth in m
172  type(param_file_type), intent(in) :: pf !< Parameter file structure
173  real, intent(out) :: max_depth !< Maximum depth of model in m
174 
175 ! This subroutine makes the appropriate call to set up the bottom depth.
176 ! This is a separate subroutine so that it can be made public and shared with
177 ! the ice-sheet code or other components.
178 ! Set up the bottom depth, G%bathyT either analytically or from file
179  character(len=40) :: mdl = "MOM_initialize_topography" ! This subroutine's name.
180  character(len=200) :: config
181 
182  call get_param(pf, mdl, "TOPO_CONFIG", config, &
183  "This specifies how bathymetry is specified: \n"//&
184  " \t file - read bathymetric information from the file \n"//&
185  " \t\t specified by (TOPO_FILE).\n"//&
186  " \t flat - flat bottom set to MAXIMUM_DEPTH. \n"//&
187  " \t bowl - an analytically specified bowl-shaped basin \n"//&
188  " \t\t ranging between MAXIMUM_DEPTH and MINIMUM_DEPTH. \n"//&
189  " \t spoon - a similar shape to 'bowl', but with an vertical \n"//&
190  " \t\t wall at the southern face. \n"//&
191  " \t halfpipe - a zonally uniform channel with a half-sine \n"//&
192  " \t\t profile in the meridional direction. \n"//&
193  " \t benchmark - use the benchmark test case topography. \n"//&
194  " \t DOME - use a slope and channel configuration for the \n"//&
195  " \t\t DOME sill-overflow test case. \n"//&
196  " \t ISOMIP - use a slope and channel configuration for the \n"//&
197  " \t\t ISOMIP test case. \n"//&
198  " \t DOME2D - use a shelf and slope configuration for the \n"//&
199  " \t\t DOME2D gravity current/overflow test case. \n"//&
200  " \t Kelvin - flat but with rotated land mask.\n"//&
201  " \t seamount - Gaussian bump for spontaneous motion test case.\n"//&
202  " \t shelfwave - exponential slope for shelfwave test case.\n"//&
203  " \t supercritical - flat but with 8.95 degree land mask.\n"//&
204  " \t Phillips - ACC-like idealized topography used in the Phillips config.\n"//&
205  " \t dense - Denmark Strait-like dense water formation and overflow.\n"//&
206  " \t USER - call a user modified routine.", &
207  fail_if_missing=.true.)
208  max_depth = -1.e9; call read_param(pf, "MAXIMUM_DEPTH", max_depth)
209  select case ( trim(config) )
210  case ("file"); call initialize_topography_from_file(d, g, pf)
211  case ("flat"); call initialize_topography_named(d, g, pf, config, max_depth)
212  case ("spoon"); call initialize_topography_named(d, g, pf, config, max_depth)
213  case ("bowl"); call initialize_topography_named(d, g, pf, config, max_depth)
214  case ("halfpipe"); call initialize_topography_named(d, g, pf, config, max_depth)
215  case ("DOME"); call dome_initialize_topography(d, g, pf, max_depth)
216  case ("ISOMIP"); call isomip_initialize_topography(d, g, pf, max_depth)
217  case ("benchmark"); call benchmark_initialize_topography(d, g, pf, max_depth)
218  case ("DOME2D"); call dome2d_initialize_topography(d, g, pf, max_depth)
219  case ("Kelvin"); call kelvin_initialize_topography(d, g, pf, max_depth)
220  case ("sloshing"); call sloshing_initialize_topography(d, g, pf, max_depth)
221  case ("seamount"); call seamount_initialize_topography(d, g, pf, max_depth)
222  case ("shelfwave"); call shelfwave_initialize_topography(d, g, pf, max_depth)
223  case ("supercritical"); call supercritical_initialize_topography(d, g, pf, max_depth)
224  case ("Phillips"); call phillips_initialize_topography(d, g, pf, max_depth)
225  case ("dense"); call dense_water_initialize_topography(d, g, pf, max_depth)
226  case ("USER"); call user_initialize_topography(d, g, pf, max_depth)
227  case default ; call mom_error(fatal,"MOM_initialize_topography: "// &
228  "Unrecognized topography setup '"//trim(config)//"'")
229  end select
230  if (max_depth>0.) then
231  call log_param(pf, mdl, "MAXIMUM_DEPTH", max_depth, &
232  "The maximum depth of the ocean.", units="m")
233  else
234  max_depth = diagnosemaximumdepth(d,g)
235  call log_param(pf, mdl, "!MAXIMUM_DEPTH", max_depth, &
236  "The (diagnosed) maximum depth of the ocean.", units="m")
237  endif
238  if (trim(config) .ne. "DOME") then
239  call limit_topography(d, g, pf, max_depth)
240  endif
241 
Here is the call graph for this function:
Here is the caller graph for this function: