MOM6
MOM_dynamics_unsplit.F90
Go to the documentation of this file.
2 
3 !***********************************************************************
4 !* GNU General Public License *
5 !* This file is a part of MOM. *
6 !* *
7 !* MOM is free software; you can redistribute it and/or modify it and *
8 !* are expected to follow the terms of the GNU General Public License *
9 !* as published by the Free Software Foundation; either version 2 of *
10 !* the License, or (at your option) any later version. *
11 !* *
12 !* MOM is distributed in the hope that it will be useful, but WITHOUT *
13 !* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
14 !* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public *
15 !* License for more details. *
16 !* *
17 !* For the full text of the GNU General Public License, *
18 !* write to: Free Software Foundation, Inc., *
19 !* 675 Mass Ave, Cambridge, MA 02139, USA. *
20 !* or see: http://www.gnu.org/licenses/gpl.html *
21 !***********************************************************************
22 
23 !********+*********+*********+*********+*********+*********+*********+**
24 !* *
25 !* By Robert Hallberg, 1993-2012 *
26 !* *
27 !* This file contains code that does the time-stepping of the *
28 !* adiabatic dynamic core, in this case with an unsplit third-order *
29 !* Runge-Kutta time stepping scheme for the momentum and a forward- *
30 !* backward coupling between the momentum and continuity equations. *
31 !* This was the orignal unsplit time stepping scheme used in early *
32 !* versions of HIM and its precuror. While it is very simple and *
33 !* accurate, it is much less efficient that the split time stepping *
34 !* scheme for realistic oceanographic applications. It has been *
35 !* retained for all of these years primarily to verify that the split *
36 !* scheme is giving the right answers, and to debug the failings of *
37 !* the split scheme when it is not. The split time stepping scheme *
38 !* is now sufficiently robust that it should be first choice for *
39 !* almost any conceivable application, except perhaps from cases *
40 !* with just a few layers for which the exact timing of the high- *
41 !* frequency barotropic gravity waves is of paramount importance. *
42 !* This scheme is slightly more efficient than the other unsplit *
43 !* scheme that can be found in MOM_dynamics_unsplit_RK2.F90. *
44 !* *
45 !* The subroutine step_MOM_dyn_unsplit actually does the time *
46 !* stepping, while register_restarts_dyn_unsplit sets the fields *
47 !* that are found in a full restart file with this scheme, and *
48 !* initialize_dyn_unsplit initializes the cpu clocks that are * *
49 !* used in this module. For largely historical reasons, this module *
50 !* does not have its own control structure, but shares the same *
51 !* control structure with MOM.F90 and the other MOM_dynamics_... *
52 !* modules. *
53 !* *
54 !* Macros written all in capital letters are defined in MOM_memory.h. *
55 !* *
56 !* A small fragment of the grid is shown below: *
57 !* *
58 !* j+1 x ^ x ^ x At x: q, CoriolisBu *
59 !* j+1 > o > o > At ^: v, PFv, CAv, vh, diffv, tauy, vbt, vhtr *
60 !* j x ^ x ^ x At >: u, PFu, CAu, uh, diffu, taux, ubt, uhtr *
61 !* j > o > o > At o: h, bathyT, eta, T, S, tr *
62 !* j-1 x ^ x ^ x *
63 !* i-1 i i+1 *
64 !* i i+1 *
65 !* *
66 !* The boundaries always run through q grid points (x). *
67 !* *
68 !********+*********+*********+*********+*********+*********+*********+**
69 
70 
73 use mom_forcing_type, only : forcing
75 use mom_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
76 use mom_cpu_clock, only : clock_component, clock_subcomponent
77 use mom_cpu_clock, only : clock_module_driver, clock_module, clock_routine
79 use mom_diag_mediator, only : disable_averaging, post_data, safe_alloc_ptr
85 use mom_domains, only : to_south, to_west, to_all, cgrid_ne, scalar_pair
86 use mom_error_handler, only : mom_error, mom_mesg, fatal, warning, is_root_pe
88 use mom_get_input, only : directories
89 use mom_io, only : mom_io_init, vardesc
92 use mom_time_manager, only : time_type, set_time, time_type_to_real, operator(+)
93 use mom_time_manager, only : operator(-), operator(>), operator(*), operator(/)
94 
95 use mom_ale, only : ale_cs
100 use mom_grid, only : ocean_grid_type
101 use mom_hor_index, only : hor_index_type
105 use mom_meke_types, only : meke_type
116 
117 implicit none ; private
118 
119 #include <MOM_memory.h>
120 type, public :: mom_dyn_unsplit_cs ; private
121  real allocable_, dimension(NIMEMB_PTR_,NJMEM_,NKMEM_) :: &
122  cau, & ! CAu = f*v - u.grad(u) in m s-2.
123  pfu, & ! PFu = -dM/dx, in m s-2.
124  diffu ! Zonal acceleration due to convergence of the along-isopycnal
125  ! stress tensor, in m s-2.
126 
127  real allocable_, dimension(NIMEM_,NJMEMB_PTR_,NKMEM_) :: &
128  cav, & ! CAv = -f*u - u.grad(v) in m s-2.
129  pfv, & ! PFv = -dM/dy, in m s-2.
130  diffv ! Meridional acceleration due to convergence of the
131  ! along-isopycnal stress tensor, in m s-2.
132 
133  real, pointer, dimension(:,:) :: taux_bot => null(), tauy_bot => null()
134  ! The frictional bottom stresses from the ocean to the seafloor, in Pa.
135 
136  logical :: debug ! If true, write verbose checksums for debugging purposes.
137 
138  logical :: module_is_initialized = .false.
139 
140  integer :: id_uh = -1, id_vh = -1
141  integer :: id_pfu = -1, id_pfv = -1, id_cau = -1, id_cav = -1
142 
143  type(diag_ctrl), pointer :: diag ! A structure that is used to regulate the
144  ! timing of diagnostic output.
145  type(accel_diag_ptrs), pointer :: adp ! A structure pointing to the various
146  ! accelerations in the momentum equations,
147  ! which can later be used to calculate
148  ! derived diagnostics like energy budgets.
149  type(cont_diag_ptrs), pointer :: cdp ! A structure with pointers to various
150  ! terms in the continuity equations,
151  ! which can later be used to calculate
152  ! derived diagnostics like energy budgets.
153 ! The remainder of the structure is pointers to child subroutines' control strings.
154  type(hor_visc_cs), pointer :: hor_visc_csp => null()
155  type(continuity_cs), pointer :: continuity_csp => null()
156  type(coriolisadv_cs), pointer :: coriolisadv_csp => null()
157  type(pressureforce_cs), pointer :: pressureforce_csp => null()
158  type(vertvisc_cs), pointer :: vertvisc_csp => null()
159  type(set_visc_cs), pointer :: set_visc_csp => null()
160  type(ocean_obc_type), pointer :: obc => null() ! A pointer to an open boundary
161  ! condition type that specifies whether, where, and what open boundary
162  ! conditions are used. If no open BCs are used, this pointer stays
163  ! nullified. Flather OBCs use open boundary_CS as well.
164  type(update_obc_cs), pointer :: update_obc_csp => null()
165  type(tidal_forcing_cs), pointer :: tides_csp => null()
166 
167 ! This is a copy of the pointer in the top-level control structure.
168  type(ale_cs), pointer :: ale_csp => null()
169 
170 end type mom_dyn_unsplit_cs
171 
174 
178 
179 contains
180 
181 ! =============================================================================
182 
183 subroutine step_mom_dyn_unsplit(u, v, h, tv, visc, Time_local, dt, fluxes, &
184  p_surf_begin, p_surf_end, uh, vh, uhtr, vhtr, eta_av, G, GV, CS, &
185  VarMix, MEKE)
186  type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure.
187  type(verticalgrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
188  real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
189  intent(inout) :: u !< The zonal velocity, in m s-1.
190  real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
191  intent(inout) :: v !< The meridional velocity, in m s-1.
192  real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
193  intent(inout) :: h !< Layer thicknesses, in H.
194  !! (usually m or kg m-2).
195  type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various
196  !! thermodynamic variables.
197  type(vertvisc_type), intent(inout) :: visc !< A structure containing vertical
198  !! viscosities, bottom drag viscosities, and related fields.
199  type(time_type), intent(in) :: Time_local !< The model time at the end
200  !! of the time step.
201  real, intent(in) :: dt !< The dynamics time step, in s.
202  type(forcing), intent(in) :: fluxes !< A structure containing pointers to
203  !! any possible forcing fields. Unused fields have NULL ptrs.
204  real, dimension(:,:), pointer :: p_surf_begin !< A pointer (perhaps NULL) to the
205  !! surface pressure at the beginning of this dynamic step, in Pa.
206  real, dimension(:,:), pointer :: p_surf_end !< A pointer (perhaps NULL) to the
207  !! surface pressure at the end of this dynamic step, in Pa.
208  real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
209  intent(inout) :: uh !< The zonal volume or mass transport,
210  !! in m3 s-1 or kg s-1.
211  real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
212  intent(inout) :: vh !< The meridional volume or mass
213  !! transport, in m3 s-1 or kg s-1.
214  real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
215  intent(inout) :: uhtr !< he accumulated zonal volume or mass
216  !! transport since the last tracer advection, in m3 or kg.
217  real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
218  intent(inout) :: vhtr !< The accumulated meridional volume or
219  !! mass transport since the last tracer advection, in m3 or kg.
220  real, dimension(SZI_(G),SZJ_(G)), intent(out) :: eta_av !< The time-mean free surface height or
221  !! column mass, in m or kg m-2.
222  type(mom_dyn_unsplit_cs), pointer :: CS !< The control structure set up by
223  !! initialize_dyn_unsplit.
224  type(varmix_cs), pointer :: VarMix !< A pointer to a structure with fields
225  !! that specify the spatially variable viscosities.
226  type(meke_type), pointer :: MEKE !< A pointer to a structure containing
227  !! fields related to the Mesoscale Eddy Kinetic Energy.
228 ! Arguments: u - The input and output zonal velocity, in m s-1.
229 ! (inout) v - The input and output meridional velocity, in m s-1.
230 ! (inout) h - The input and output layer thicknesses, in m or kg m-2,
231 ! depending on whether the Boussinesq approximation is made.
232 ! (in) tv - a structure pointing to various thermodynamic variables.
233 ! (inout) visc - A structure containing vertical viscosities, bottom drag
234 ! viscosities, and related fields.
235 ! (in) Time_local - The model time at the end of the time step.
236 ! (in) dt - The time step in s.
237 ! (in) fluxes - A structure containing pointers to any possible
238 ! forcing fields. Unused fields have NULL ptrs.
239 ! (in) p_surf_begin - A pointer (perhaps NULL) to the surface pressure
240 ! at the beginning of this dynamic step, in Pa.
241 ! (in) p_surf_end - A pointer (perhaps NULL) to the surface pressure
242 ! at the end of this dynamic step, in Pa.
243 ! (inout) uh - The zonal volume or mass transport, in m3 s-1 or kg s-1.
244 ! (inout) vh - The meridional volume or mass transport, in m3 s-1 or kg s-1.
245 ! (inout) uhtr - The accumulated zonal volume or mass transport since the last
246 ! tracer advection, in m3 or kg.
247 ! (inout) vhtr - The accumulated meridional volume or mass transport since the last
248 ! tracer advection, in m3 or kg.
249 ! (out) eta_av - The time-mean free surface height or column mass, in m or
250 ! kg m-2.
251 ! (in) G - The ocean's grid structure.
252 ! (in) GV - The ocean's vertical grid structure.
253 ! (in) CS - The control structure set up by initialize_dyn_unsplit.
254 ! (in) VarMix - A pointer to a structure with fields that specify the
255 ! spatially variable viscosities.
256 ! (inout) MEKE - A pointer to a structure containing fields related to
257 ! the Mesoscale Eddy Kinetic Energy.
258 
259  real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: h_av, hp
260  real, dimension(SZIB_(G),SZJ_(G),SZK_(G)) :: up, upp
261  real, dimension(SZI_(G),SZJB_(G),SZK_(G)) :: vp, vpp
262  real, dimension(:,:), pointer :: p_surf
263  real :: dt_pred ! The time step for the predictor part of the baroclinic
264  ! time stepping.
265  logical :: dyn_p_surf
266  integer :: i, j, k, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz
267  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
268  isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
269  dt_pred = dt / 3.0
270 
271  h_av(:,:,:) = 0; hp(:,:,:) = 0
272  up(:,:,:) = 0; upp(:,:,:) = 0
273  vp(:,:,:) = 0; vpp(:,:,:) = 0
274 
275  dyn_p_surf = associated(p_surf_begin) .and. associated(p_surf_end)
276  if (dyn_p_surf) then
277  call safe_alloc_ptr(p_surf,g%isd,g%ied,g%jsd,g%jed) ; p_surf(:,:) = 0.0
278  else
279  p_surf => fluxes%p_surf
280  endif
281 
282 ! Matsuno's third order accurate three step scheme is used to step
283 ! all of the fields except h. h is stepped separately.
284 
285  if (cs%debug) then
286  call mom_state_chksum("Start First Predictor ", u, v, h, uh, vh, g, gv)
287  endif
288 
289 ! diffu = horizontal viscosity terms (u,h)
290  call enable_averaging(dt,time_local, cs%diag)
291  call cpu_clock_begin(id_clock_horvisc)
292  call horizontal_viscosity(u, v, h, cs%diffu, cs%diffv, meke, varmix, &
293  g, gv, cs%hor_visc_CSp)
294  call cpu_clock_end(id_clock_horvisc)
295  call disable_averaging(cs%diag)
296 
297 ! uh = u*h
298 ! hp = h + dt/2 div . uh
299  call cpu_clock_begin(id_clock_continuity)
300  call continuity(u, v, h, hp, uh, vh, dt*0.5, g, gv, cs%continuity_CSp, &
301  obc=cs%OBC)
302  call cpu_clock_end(id_clock_continuity)
303  call cpu_clock_begin(id_clock_pass)
304  call pass_var(hp, g%Domain)
305  call pass_vector(uh, vh, g%Domain)
306  call cpu_clock_end(id_clock_pass)
307 
308  call enable_averaging(0.5*dt,time_local-set_time(int(0.5*dt)), cs%diag)
309 ! Here the first half of the thickness fluxes are offered for averaging.
310  if (cs%id_uh > 0) call post_data(cs%id_uh, uh, cs%diag)
311  if (cs%id_vh > 0) call post_data(cs%id_vh, vh, cs%diag)
312  call disable_averaging(cs%diag)
313 
314 ! h_av = (h + hp)/2
315 ! u = u + dt diffu
316  call cpu_clock_begin(id_clock_mom_update)
317  do k=1,nz
318  do j=js-2,je+2 ; do i=is-2,ie+2
319  h_av(i,j,k) = (h(i,j,k) + hp(i,j,k)) * 0.5
320  enddo ; enddo
321  do j=js,je ; do i=isq,ieq
322  u(i,j,k) = u(i,j,k) + dt * cs%diffu(i,j,k) * g%mask2dCu(i,j)
323  enddo ; enddo
324  do j=jsq,jeq ; do i=is,ie
325  v(i,j,k) = v(i,j,k) + dt * cs%diffv(i,j,k) * g%mask2dCv(i,j)
326  enddo ; enddo
327  do j=js-2,je+2 ; do i=isq-2,ieq+2
328  uhtr(i,j,k) = uhtr(i,j,k) + 0.5*dt*uh(i,j,k)
329  enddo ; enddo
330  do j=jsq-2,jeq+2 ; do i=is-2,ie+2
331  vhtr(i,j,k) = vhtr(i,j,k) + 0.5*dt*vh(i,j,k)
332  enddo ; enddo
333  enddo
334  call cpu_clock_end(id_clock_mom_update)
335  call cpu_clock_begin(id_clock_pass)
336  call pass_vector(u, v, g%Domain)
337  call cpu_clock_end(id_clock_pass)
338 
339 ! CAu = -(f+zeta)/h_av vh + d/dx KE
340  call cpu_clock_begin(id_clock_cor)
341  call coradcalc(u, v, h_av, uh, vh, cs%CAu, cs%CAv, cs%OBC, cs%ADp, &
342  g, gv, cs%CoriolisAdv_CSp)
343  call cpu_clock_end(id_clock_cor)
344 
345 ! PFu = d/dx M(h_av,T,S)
346  call cpu_clock_begin(id_clock_pres)
347  if (dyn_p_surf) then ; do j=js-2,je+2 ; do i=is-2,ie+2
348  p_surf(i,j) = 0.75*p_surf_begin(i,j) + 0.25*p_surf_end(i,j)
349  enddo ; enddo ; endif
350  call pressureforce(h_av, tv, cs%PFu, cs%PFv, g, gv, &
351  cs%PressureForce_CSp, cs%ALE_CSp, p_surf)
352  call cpu_clock_end(id_clock_pres)
353 
354  if (associated(cs%OBC)) then; if (cs%OBC%update_OBC) then
355  call update_obc_data(cs%OBC, g, gv, tv, h, cs%update_OBC_CSp, time_local)
356  endif; endif
357  if (associated(cs%OBC)) then
358  call open_boundary_zero_normal_flow(cs%OBC, g, cs%PFu, cs%PFv)
359  call open_boundary_zero_normal_flow(cs%OBC, g, cs%CAu, cs%CAv)
360  endif
361 
362 ! up = u + dt_pred * (PFu + CAu)
363  call cpu_clock_begin(id_clock_mom_update)
364  do k=1,nz ; do j=js,je ; do i=isq,ieq
365  up(i,j,k) = g%mask2dCu(i,j) * (u(i,j,k) + dt_pred * &
366  (cs%PFu(i,j,k) + cs%CAu(i,j,k)))
367  enddo ; enddo ; enddo
368  do k=1,nz ; do j=jsq,jeq ; do i=is,ie
369  vp(i,j,k) = g%mask2dCv(i,j) * (v(i,j,k) + dt_pred * &
370  (cs%PFv(i,j,k) + cs%CAv(i,j,k)))
371  enddo ; enddo ; enddo
372  call cpu_clock_end(id_clock_mom_update)
373 
374  if (cs%debug) then
375  call mom_state_chksum("Predictor 1", up, vp, h_av, uh, vh, g, gv)
376  call mom_accel_chksum("Predictor 1 accel", cs%CAu, cs%CAv, cs%PFu, cs%PFv,&
377  cs%diffu, cs%diffv, g, gv)
378  endif
379 
380  ! up <- up + dt/2 d/dz visc d/dz up
381  call cpu_clock_begin(id_clock_vertvisc)
382  call enable_averaging(dt, time_local, cs%diag)
383  call set_viscous_ml(u, v, h_av, tv, fluxes, visc, dt*0.5, g, gv, &
384  cs%set_visc_CSp)
385  call disable_averaging(cs%diag)
386  call vertvisc_coef(up, vp, h_av, fluxes, visc, dt*0.5, g, gv, &
387  cs%vertvisc_CSp, cs%OBC)
388  call vertvisc(up, vp, h_av, fluxes, visc, dt*0.5, cs%OBC, cs%ADp, cs%CDp, &
389  g, gv, cs%vertvisc_CSp)
390  call cpu_clock_end(id_clock_vertvisc)
391  call cpu_clock_begin(id_clock_pass)
392  call pass_vector(up, vp, g%Domain)
393  call cpu_clock_end(id_clock_pass)
394 
395 ! uh = up * hp
396 ! h_av = hp + dt/2 div . uh
397  call cpu_clock_begin(id_clock_continuity)
398  call continuity(up, vp, hp, h_av, uh, vh, &
399  (0.5*dt), g, gv, cs%continuity_CSp, obc=cs%OBC)
400  call cpu_clock_end(id_clock_continuity)
401  call cpu_clock_begin(id_clock_pass)
402  call pass_var(h_av, g%Domain)
403  call pass_vector(uh, vh, g%Domain)
404  call cpu_clock_end(id_clock_pass)
405 
406 ! h_av <- (hp + h_av)/2
407  do k=1,nz ; do j=js-2,je+2 ; do i=is-2,ie+2
408  h_av(i,j,k) = (hp(i,j,k) + h_av(i,j,k)) * 0.5
409  enddo ; enddo ; enddo
410 
411 ! CAu = -(f+zeta(up))/h_av vh + d/dx KE(up)
412  call cpu_clock_begin(id_clock_cor)
413  call coradcalc(up, vp, h_av, uh, vh, cs%CAu, cs%CAv, cs%OBC, cs%ADp, &
414  g, gv, cs%CoriolisAdv_CSp)
415  call cpu_clock_end(id_clock_cor)
416 
417 ! PFu = d/dx M(h_av,T,S)
418  call cpu_clock_begin(id_clock_pres)
419  if (dyn_p_surf) then ; do j=js-2,je+2 ; do i=is-2,ie+2
420  p_surf(i,j) = 0.25*p_surf_begin(i,j) + 0.75*p_surf_end(i,j)
421  enddo ; enddo ; endif
422  call pressureforce(h_av, tv, cs%PFu, cs%PFv, g, gv, &
423  cs%PressureForce_CSp, cs%ALE_CSp, p_surf)
424  call cpu_clock_end(id_clock_pres)
425 
426  if (associated(cs%OBC)) then; if (cs%OBC%update_OBC) then
427  call update_obc_data(cs%OBC, g, gv, tv, h, cs%update_OBC_CSp, time_local)
428  endif; endif
429  if (associated(cs%OBC)) then
430  call open_boundary_zero_normal_flow(cs%OBC, g, cs%PFu, cs%PFv)
431  call open_boundary_zero_normal_flow(cs%OBC, g, cs%CAu, cs%CAv)
432  endif
433 
434 ! upp = u + dt/2 * ( PFu + CAu )
435  call cpu_clock_begin(id_clock_mom_update)
436  do k=1,nz ; do j=js,je ; do i=isq,ieq
437  upp(i,j,k) = g%mask2dCu(i,j) * (u(i,j,k) + dt * 0.5 * &
438  (cs%PFu(i,j,k) + cs%CAu(i,j,k)))
439  enddo ; enddo ; enddo
440  do k=1,nz ; do j=jsq,jeq ; do i=is,ie
441  vpp(i,j,k) = g%mask2dCv(i,j) * (v(i,j,k) + dt * 0.5 * &
442  (cs%PFv(i,j,k) + cs%CAv(i,j,k)))
443  enddo ; enddo ; enddo
444  call cpu_clock_end(id_clock_mom_update)
445 
446  if (cs%debug) then
447  call mom_state_chksum("Predictor 2", upp, vpp, h_av, uh, vh, g, gv)
448  call mom_accel_chksum("Predictor 2 accel", cs%CAu, cs%CAv, cs%PFu, cs%PFv,&
449  cs%diffu, cs%diffv, g, gv)
450  endif
451 
452 ! upp <- upp + dt/2 d/dz visc d/dz upp
453  call cpu_clock_begin(id_clock_vertvisc)
454  call vertvisc_coef(upp, vpp, hp, fluxes, visc, dt*0.5, g, gv, &
455  cs%vertvisc_CSp, cs%OBC)
456  call vertvisc(upp, vpp, hp, fluxes, visc, dt*0.5, cs%OBC, cs%ADp, cs%CDp, &
457  g, gv, cs%vertvisc_CSp)
458  call cpu_clock_end(id_clock_vertvisc)
459  call cpu_clock_begin(id_clock_pass)
460  call pass_vector(upp, vpp, g%Domain)
461  call cpu_clock_end(id_clock_pass)
462 
463 ! uh = upp * hp
464 ! h = hp + dt/2 div . uh
465  call cpu_clock_begin(id_clock_continuity)
466  call continuity(upp, vpp, hp, h, uh, vh, &
467  (dt*0.5), g, gv, cs%continuity_CSp, obc=cs%OBC)
468  call cpu_clock_end(id_clock_continuity)
469  call cpu_clock_begin(id_clock_pass)
470  call pass_var(h, g%Domain)
471  call pass_vector(uh, vh, g%Domain)
472  call cpu_clock_end(id_clock_pass)
473  ! Whenever thickness changes let the diag manager know, target grids
474  ! for vertical remapping may need to be regenerated.
475  call diag_update_remap_grids(cs%diag)
476 
477  call enable_averaging(0.5*dt, time_local, cs%diag)
478 ! Here the second half of the thickness fluxes are offered for averaging.
479  if (cs%id_uh > 0) call post_data(cs%id_uh, uh, cs%diag)
480  if (cs%id_vh > 0) call post_data(cs%id_vh, vh, cs%diag)
481  call disable_averaging(cs%diag)
482  call enable_averaging(dt, time_local, cs%diag)
483 
484 ! h_av = (h + hp)/2
485  do k=1,nz
486  do j=js-2,je+2 ; do i=is-2,ie+2
487  h_av(i,j,k) = 0.5*(h(i,j,k) + hp(i,j,k))
488  enddo ; enddo
489  do j=js-2,je+2 ; do i=isq-2,ieq+2
490  uhtr(i,j,k) = uhtr(i,j,k) + 0.5*dt*uh(i,j,k)
491  enddo ; enddo
492  do j=jsq-2,jeq+2 ; do i=is-2,ie+2
493  vhtr(i,j,k) = vhtr(i,j,k) + 0.5*dt*vh(i,j,k)
494  enddo ; enddo
495  enddo
496 
497 ! CAu = -(f+zeta(upp))/h_av vh + d/dx KE(upp)
498  call cpu_clock_begin(id_clock_cor)
499  call coradcalc(upp, vpp, h_av, uh, vh, cs%CAu, cs%CAv, cs%OBC, cs%ADp, &
500  g, gv, cs%CoriolisAdv_CSp)
501  call cpu_clock_end(id_clock_cor)
502 
503 ! PFu = d/dx M(h_av,T,S)
504  call cpu_clock_begin(id_clock_pres)
505  call pressureforce(h_av, tv, cs%PFu, cs%PFv, g, gv, &
506  cs%PressureForce_CSp, cs%ALE_CSp, p_surf)
507  call cpu_clock_end(id_clock_pres)
508 
509  if (associated(cs%OBC)) then; if (cs%OBC%update_OBC) then
510  call update_obc_data(cs%OBC, g, gv, tv, h, cs%update_OBC_CSp, time_local)
511  endif; endif
512 
513 ! u = u + dt * ( PFu + CAu )
514  if (associated(cs%OBC)) then
515  call open_boundary_zero_normal_flow(cs%OBC, g, cs%PFu, cs%PFv)
516  call open_boundary_zero_normal_flow(cs%OBC, g, cs%CAu, cs%CAv)
517  endif
518  do k=1,nz ; do j=js,je ; do i=isq,ieq
519  u(i,j,k) = g%mask2dCu(i,j) * (u(i,j,k) + dt * &
520  (cs%PFu(i,j,k) + cs%CAu(i,j,k)))
521  enddo ; enddo ; enddo
522  do k=1,nz ; do j=jsq,jeq ; do i=is,ie
523  v(i,j,k) = g%mask2dCv(i,j) * (v(i,j,k) + dt * &
524  (cs%PFv(i,j,k) + cs%CAv(i,j,k)))
525  enddo ; enddo ; enddo
526 
527 ! u <- u + dt d/dz visc d/dz u
528  call cpu_clock_begin(id_clock_vertvisc)
529  call vertvisc_coef(u, v, h_av, fluxes, visc, dt, g, gv, cs%vertvisc_CSp, cs%OBC)
530  call vertvisc(u, v, h_av, fluxes, visc, dt, cs%OBC, cs%ADp, cs%CDp, &
531  g, gv, cs%vertvisc_CSp, cs%taux_bot, cs%tauy_bot)
532  call cpu_clock_end(id_clock_vertvisc)
533  call cpu_clock_begin(id_clock_pass)
534  call pass_vector(u, v, g%Domain)
535  call cpu_clock_end(id_clock_pass)
536 
537  if (cs%debug) then
538  call mom_state_chksum("Corrector", u, v, h, uh, vh, g, gv)
539  call mom_accel_chksum("Corrector accel", cs%CAu, cs%CAv, cs%PFu, cs%PFv, &
540  cs%diffu, cs%diffv, g, gv)
541  endif
542 
543  if (gv%Boussinesq) then
544  do j=js,je ; do i=is,ie ; eta_av(i,j) = -g%bathyT(i,j) ; enddo ; enddo
545  else
546  do j=js,je ; do i=is,ie ; eta_av(i,j) = 0.0 ; enddo ; enddo
547  endif
548  do k=1,nz ; do j=js,je ; do i=is,ie
549  eta_av(i,j) = eta_av(i,j) + h_av(i,j,k)
550  enddo ; enddo ; enddo
551 
552  if (dyn_p_surf) deallocate(p_surf)
553 
554 ! Here various terms used in to update the momentum equations are
555 ! offered for averaging.
556  if (cs%id_PFu > 0) call post_data(cs%id_PFu, cs%PFu, cs%diag)
557  if (cs%id_PFv > 0) call post_data(cs%id_PFv, cs%PFv, cs%diag)
558  if (cs%id_CAu > 0) call post_data(cs%id_CAu, cs%CAu, cs%diag)
559  if (cs%id_CAv > 0) call post_data(cs%id_CAv, cs%CAv, cs%diag)
560 
561 end subroutine step_mom_dyn_unsplit
562 
563 ! =============================================================================
564 
565 subroutine register_restarts_dyn_unsplit(HI, GV, param_file, CS, restart_CS)
566  type(hor_index_type), intent(in) :: HI !< A horizontal index type structure.
567  type(verticalgrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
568  type(param_file_type), intent(in) :: param_file !< A structure to parse for
569  !! run-time parameters.
570  type(mom_dyn_unsplit_cs), pointer :: CS !< The control structure set up by
571  !! initialize_dyn_unsplit.
572  type(mom_restart_cs), pointer :: restart_CS !< A pointer to the restart control structure.
573 
574 ! This subroutine sets up any auxiliary restart variables that are specific
575 ! to the unsplit time stepping scheme. All variables registered here should
576 ! have the ability to be recreated if they are not present in a restart file.
577 
578 ! Arguments: HI - A horizontal index type structure.
579 ! (in) GV - The ocean's vertical grid structure.
580 ! (in) param_file - A structure indicating the open file to parse for
581 ! model parameter values.
582 ! (inout) CS - The control structure set up by initialize_dyn_unsplit.
583 ! (inout) restart_CS - A pointer to the restart control structure.
584 
585  type(vardesc) :: vd
586  character(len=40) :: mdl = "MOM_dynamics_unsplit" ! This module's name.
587  character(len=48) :: thickness_units, flux_units
588  integer :: isd, ied, jsd, jed, nz, IsdB, IedB, JsdB, JedB
589  isd = hi%isd ; ied = hi%ied ; jsd = hi%jsd ; jed = hi%jed ; nz = gv%ke
590  isdb = hi%IsdB ; iedb = hi%IedB ; jsdb = hi%JsdB ; jedb = hi%JedB
591 
592 ! This is where a control structure that is specific to this module would be allocated.
593  if (associated(cs)) then
594  call mom_error(warning, "register_restarts_dyn_unsplit called with an associated "// &
595  "control structure.")
596  return
597  endif
598  allocate(cs)
599 
600  alloc_(cs%diffu(isdb:iedb,jsd:jed,nz)) ; cs%diffu(:,:,:) = 0.0
601  alloc_(cs%diffv(isd:ied,jsdb:jedb,nz)) ; cs%diffv(:,:,:) = 0.0
602  alloc_(cs%CAu(isdb:iedb,jsd:jed,nz)) ; cs%CAu(:,:,:) = 0.0
603  alloc_(cs%CAv(isd:ied,jsdb:jedb,nz)) ; cs%CAv(:,:,:) = 0.0
604  alloc_(cs%PFu(isdb:iedb,jsd:jed,nz)) ; cs%PFu(:,:,:) = 0.0
605  alloc_(cs%PFv(isd:ied,jsdb:jedb,nz)) ; cs%PFv(:,:,:) = 0.0
606 
607  thickness_units = get_thickness_units(gv)
608  flux_units = get_flux_units(gv)
609 
610 ! No extra restart fields are needed with this time stepping scheme.
611 
612 end subroutine register_restarts_dyn_unsplit
613 
614 subroutine initialize_dyn_unsplit(u, v, h, Time, G, GV, param_file, diag, CS, &
615  restart_CS, Accel_diag, Cont_diag, MIS, &
616  OBC, update_OBC_CSp, ALE_CSp, setVisc_CSp, &
617  visc, dirs, ntrunc)
618  type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure.
619  type(verticalgrid_type), intent(in) :: GV !< The ocean's vertical grid
620  !! structure.
621  real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
622  intent(inout) :: u !< The zonal velocity, in m s-1.
623  real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
624  intent(inout) :: v !< The meridional velocity, in m s-1.
625  real, dimension(SZI_(G),SZJ_(G),SZK_(G)) , &
626  intent(inout) :: h !< Layer thicknesses, in H
627  !! (usually m or kg m-2).
628  type(time_type), target, intent(in) :: Time !< The current model time.
629  type(param_file_type), intent(in) :: param_file !< A structure to parse
630  !! for run-time parameters.
631  type(diag_ctrl), target, intent(inout) :: diag !< A structure that is used to
632  !! regulate diagnostic output.
633  type(mom_dyn_unsplit_cs), pointer :: CS !< The control structure set up
634  !! by initialize_dyn_unsplit.
635  type(mom_restart_cs), pointer :: restart_CS !< A pointer to the restart control
636  !!structure.
637  type(accel_diag_ptrs), target, intent(inout) :: Accel_diag !< A set of pointers to the various
638  !! accelerations in the momentum equations, which can be used
639  !! for later derived diagnostics, like energy budgets.
640  type(cont_diag_ptrs), target, intent(inout) :: Cont_diag !< A structure with pointers to
641  !! various terms in the continuity
642  !! equations.
643  type(ocean_internal_state), intent(inout) :: MIS !< The "MOM6 Internal State"
644  !! structure, used to pass around pointers
645  !! to various arrays for diagnostic purposes.
646  type(ocean_obc_type), pointer :: OBC !< If open boundary conditions are
647  !! used, this points to the ocean_OBC_type
648  !! that was set up in MOM_initialization.
649  type(update_obc_cs), pointer :: update_OBC_CSp !< If open boundary condition
650  !! updates are used, this points to
651  !! the appropriate control structure.
652  type(ale_cs), pointer :: ALE_CSp !< This points to the ALE control
653  !! structure.
654  type(set_visc_cs), pointer :: setVisc_CSp !< This points to the set_visc
655  !! control structure.
656  type(vertvisc_type), intent(inout) :: visc !< A structure containing vertical
657  !! viscosities, bottom drag
658  !! viscosities, and related fields.
659  type(directories), intent(in) :: dirs !< A structure containing several
660  !! relevant directory paths.
661  integer, target, intent(inout) :: ntrunc !< A target for the variable that
662  !! records the number of times the velocity
663  !! is truncated (this should be 0).
664 
665 ! Arguments: u - The zonal velocity, in m s-1.
666 ! (inout) v - The meridional velocity, in m s-1.
667 ! (inout) h - The layer thicknesses, in m or kg m-2, depending on whether
668 ! the Boussinesq approximation is made.
669 ! (in) Time - The current model time.
670 ! (in) G - The ocean's grid structure.
671 ! (in) GV - The ocean's vertical grid structure.
672 ! (in) param_file - A structure indicating the open file to parse for
673 ! model parameter values.
674 ! (in) diag - A structure that is used to regulate diagnostic output.
675 ! (inout) CS - The control structure set up by initialize_dyn_unsplit.
676 ! (in) restart_CS - A pointer to the restart control structure.
677 ! (inout) Accel_diag - A set of pointers to the various accelerations in
678 ! the momentum equations, which can be used for later derived
679 ! diagnostics, like energy budgets.
680 ! (inout) Cont_diag - A structure with pointers to various terms in the
681 ! continuity equations.
682 ! (inout) MIS - The "MOM6 Internal State" structure, used to pass around
683 ! pointers to various arrays for diagnostic purposes.
684 ! (in) OBC - If open boundary conditions are used, this points to the
685 ! ocean_OBC_type that was set up in MOM_initialization.
686 ! (in) update_OBC_CSp - If open boundary condition updates are used,
687 ! this points to the appropriate control structure.
688 ! (in) ALE_CS - This points to the ALE control structure.
689 ! (in) setVisc_CSp - This points to the set_visc control structure.
690 ! (inout) visc - A structure containing vertical viscosities, bottom drag
691 ! viscosities, and related fields.
692 ! (in) dirs - A structure containing several relevant directory paths.
693 ! (in) ntrunc - A target for the variable that records the number of times
694 ! the velocity is truncated (this should be 0).
695 
696  ! This subroutine initializes all of the variables that are used by this
697  ! dynamic core, including diagnostics and the cpu clocks.
698  character(len=40) :: mdl = "MOM_dynamics_unsplit" ! This module's name.
699  character(len=48) :: thickness_units, flux_units
700  logical :: use_tides
701  integer :: isd, ied, jsd, jed, nz, IsdB, IedB, JsdB, JedB
702  isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed ; nz = g%ke
703  isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
704 
705  if (.not.associated(cs)) call mom_error(fatal, &
706  "initialize_dyn_unsplit called with an unassociated control structure.")
707  if (cs%module_is_initialized) then
708  call mom_error(warning, "initialize_dyn_unsplit called with a control "// &
709  "structure that has already been initialized.")
710  return
711  endif
712  cs%module_is_initialized = .true.
713 
714  cs%diag => diag
715 
716  call get_param(param_file, mdl, "DEBUG", cs%debug, &
717  "If true, write out verbose debugging data.", default=.false.)
718  call get_param(param_file, mdl, "TIDES", use_tides, &
719  "If true, apply tidal momentum forcing.", default=.false.)
720 
721  allocate(cs%taux_bot(isdb:iedb,jsd:jed)) ; cs%taux_bot(:,:) = 0.0
722  allocate(cs%tauy_bot(isd:ied,jsdb:jedb)) ; cs%tauy_bot(:,:) = 0.0
723 
724  mis%diffu => cs%diffu ; mis%diffv => cs%diffv
725  mis%PFu => cs%PFu ; mis%PFv => cs%PFv
726  mis%CAu => cs%CAu ; mis%CAv => cs%CAv
727 
728  cs%ADp => accel_diag ; cs%CDp => cont_diag
729  accel_diag%diffu => cs%diffu ; accel_diag%diffv => cs%diffv
730  accel_diag%PFu => cs%PFu ; accel_diag%PFv => cs%PFv
731  accel_diag%CAu => cs%CAu ; accel_diag%CAv => cs%CAv
732 
733  call continuity_init(time, g, gv, param_file, diag, cs%continuity_CSp)
734  call coriolisadv_init(time, g, param_file, diag, cs%ADp, cs%CoriolisAdv_CSp)
735  if (use_tides) call tidal_forcing_init(time, g, param_file, cs%tides_CSp)
736  call pressureforce_init(time, g, gv, param_file, diag, cs%PressureForce_CSp, &
737  cs%tides_CSp)
738  call hor_visc_init(time, g, param_file, diag, cs%hor_visc_CSp)
739  call vertvisc_init(mis, time, g, gv, param_file, diag, cs%ADp, dirs, &
740  ntrunc, cs%vertvisc_CSp)
741  if (.not.associated(setvisc_csp)) call mom_error(fatal, &
742  "initialize_dyn_unsplit called with setVisc_CSp unassociated.")
743  cs%set_visc_CSp => setvisc_csp
744 
745  if (associated(ale_csp)) cs%ALE_CSp => ale_csp
746  if (associated(obc)) cs%OBC => obc
747  if (associated(update_obc_csp)) cs%update_OBC_CSp => update_obc_csp
748 
749  flux_units = get_flux_units(gv)
750  cs%id_uh = register_diag_field('ocean_model', 'uh', diag%axesCuL, time, &
751  'Zonal Thickness Flux', flux_units, y_cell_method='sum', v_extensive=.true.)
752  cs%id_vh = register_diag_field('ocean_model', 'vh', diag%axesCvL, time, &
753  'Meridional Thickness Flux', flux_units, x_cell_method='sum', v_extensive=.true.)
754  cs%id_CAu = register_diag_field('ocean_model', 'CAu', diag%axesCuL, time, &
755  'Zonal Coriolis and Advective Acceleration', 'meter second-2')
756  cs%id_CAv = register_diag_field('ocean_model', 'CAv', diag%axesCvL, time, &
757  'Meridional Coriolis and Advective Acceleration', 'meter second-2')
758  cs%id_PFu = register_diag_field('ocean_model', 'PFu', diag%axesCuL, time, &
759  'Zonal Pressure Force Acceleration', 'meter second-2')
760  cs%id_PFv = register_diag_field('ocean_model', 'PFv', diag%axesCvL, time, &
761  'Meridional Pressure Force Acceleration', 'meter second-2')
762 
763  id_clock_cor = cpu_clock_id('(Ocean Coriolis & mom advection)', grain=clock_module)
764  id_clock_continuity = cpu_clock_id('(Ocean continuity equation)', grain=clock_module)
765  id_clock_pres = cpu_clock_id('(Ocean pressure force)', grain=clock_module)
766  id_clock_vertvisc = cpu_clock_id('(Ocean vertical viscosity)', grain=clock_module)
767  id_clock_horvisc = cpu_clock_id('(Ocean horizontal viscosity)', grain=clock_module)
768  id_clock_mom_update = cpu_clock_id('(Ocean momentum increments)', grain=clock_module)
769  id_clock_pass = cpu_clock_id('(Ocean message passing)', grain=clock_module)
770  id_clock_pass_init = cpu_clock_id('(Ocean init message passing)', grain=clock_routine)
771 
772 end subroutine initialize_dyn_unsplit
773 
774 subroutine end_dyn_unsplit(CS)
775  type(mom_dyn_unsplit_cs), pointer :: CS
776 ! (inout) CS - The control structure set up by initialize_dyn_unsplit.
777 
778  dealloc_(cs%diffu) ; dealloc_(cs%diffv)
779  dealloc_(cs%CAu) ; dealloc_(cs%CAv)
780  dealloc_(cs%PFu) ; dealloc_(cs%PFv)
781 
782  deallocate(cs)
783 end subroutine end_dyn_unsplit
784 
785 end module mom_dynamics_unsplit
subroutine, public mom_io_init(param_file)
Initialize the MOM_io module.
Definition: MOM_io.F90:840
subroutine, public end_dyn_unsplit(CS)
subroutine, public set_diag_mediator_grid(G, diag_cs)
subroutine, public mom_thermo_chksum(mesg, tv, G, haloshift)
subroutine, public coradcalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, CS)
Calculates the Coriolis and momentum advection contributions to the acceleration. ...
subroutine, public initialize_dyn_unsplit(u, v, h, Time, G, GV, param_file, diag, CS, restart_CS, Accel_diag, Cont_diag, MIS, OBC, update_OBC_CSp, ALE_CSp, setVisc_CSp, visc, dirs, ntrunc)
This module contains the main regridding routines. Regridding comprises two steps: (1) Interpolation ...
Definition: MOM_ALE.F90:7
character(len=48) function, public get_flux_units(GV)
Returns the model&#39;s thickness flux units, usually m^3/s or kg/s.
This module implements boundary forcing for MOM6.
subroutine, public enable_averaging(time_int_in, time_end_in, diag_cs)
subroutine, public continuity_init(Time, G, GV, param_file, diag, CS)
Initializes continuity_cs.
integer, parameter, public to_all
subroutine, public hor_visc_init(Time, G, param_file, diag, CS)
This subroutine allocates space for and calculates static variables used by this module. The metrics may be 0, 1, or 2-D arrays, while fields like the background viscosities are 2-D arrays. ALLOC is a macro defined in MOM_memory.h to either allocate for dynamic memory, or do nothing when using static memory.
The module calculates interface heights, including free surface height.
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:19
The following data type a list of diagnostic fields an their variants, as well as variables that cont...
Solve the layer continuity equation.
Controls where open boundary conditions are applied.
Implements vertical viscosity (vertvisc)
Provides the ocean grid type.
Definition: MOM_grid.F90:2
The vertvisc_type structure contains vertical viscosities, drag coefficients, and related fields...
subroutine, public pressureforce_init(Time, G, GV, param_file, diag, CS, tides_CSp)
Initialize the pressure force control structure.
Accelerations due to the Coriolis force and momentum advection.
subroutine, public diag_mediator_init(G, nz, param_file, diag_cs, doc_file_dir)
diag_mediator_init initializes the MOM diag_mediator and opens the available diagnostics file...
A thin wrapper for Boussinesq/non-Boussinesq forms of the pressure force calculation.
This module contains I/O framework code.
Definition: MOM_io.F90:2
Defines the horizontal index type (hor_index_type) used for providing index ranges.
subroutine, public mom_accel_chksum(mesg, CAu, CAv, PFu, PFv, diffu, diffv, G, GV, pbce, u_accel_bt, v_accel_bt, symmetric)
The accel_diag_ptrs structure contains pointers to arrays with accelerations, which can later be used...
Variable mixing coefficients.
subroutine, public coriolisadv_init(Time, G, param_file, diag, AD, CS)
Initializes the control structure for coriolisadv_cs.
character(len=48) function, public get_tr_flux_units(GV, tr_units, tr_vol_conc_units, tr_mass_conc_units)
Returns the model&#39;s tracer flux units.
Container for horizontal index ranges for data, computational and global domains. ...
Control structure for mom_coriolisadv.
subroutine, public horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, CS, OBC)
This subroutine determines the acceleration due to the horizontal viscosity. A combination of biharmo...
Control structure for mom_continuity.
subroutine, public register_restarts_dyn_unsplit(HI, GV, param_file, CS, restart_CS)
subroutine, public open_boundary_zero_normal_flow(OBC, G, u, v)
Applies zero values to 3d u,v fields on OBC segments.
subroutine, public radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, G, dt)
Apply radiation conditions to 3D u,v at open boundaries.
subroutine, public mom_domains_init(MOM_dom, param_file, symmetric, static_memory, NIHALO, NJHALO, NIGLOBAL, NJGLOBAL, NIPROC, NJPROC, min_halo, domain_name, include_name, param_suffix)
logical function, public is_root_pe()
The cont_diag_ptrs structure contains pointers to arrays with transports, which can later be used for...
subroutine, public pressureforce(h, tv, PFu, PFv, G, GV, CS, ALE_CSp, p_atm, pbce, eta)
A thin layer between the model and the Boussinesq and non-Boussinesq pressure force routines...
character(len=48) function, public get_thickness_units(GV)
Returns the model&#39;s thickness units, usually m or kg/m^2.
The ocean_internal_state structure contains pointers to all of the prognostic variables allocated in ...
subroutine, public vertvisc_coef(u, v, h, fluxes, visc, dt, G, GV, CS, OBC)
Calculate the coupling coefficients (CSa_u and CSa_v) and effective layer thicknesses (CSh_u and CSh_...
subroutine, public update_obc_data(OBC, G, GV, tv, h, CS, Time)
Calls appropriate routine to update the open boundary conditions.
Structure that contains pointers to the boundary forcing used to drive the liquid ocean simulated by ...
subroutine, public vertvisc_init(MIS, Time, G, GV, param_file, diag, ADp, dirs, ntrunc, CS)
Initialise the vertical friction module.
subroutine, public set_viscous_ml(u, v, h, tv, fluxes, visc, dt, G, GV, CS)
The following subroutine calculates the thickness of the surface boundary layer for applying an eleva...
subroutine, public mom_mesg(message, verb, all_print)
Type for describing a variable, typically a tracer.
Definition: MOM_io.F90:51
integer function, public register_static_field(module_name, field_name, axes, long_name, units, missing_value, range, mask_variant, standard_name, do_not_log, interp_method, tile_count, cmor_field_name, cmor_long_name, cmor_units, cmor_standard_name, area)
Registers a static diagnostic, returning an integer handle.
subroutine, public tidal_forcing_init(Time, G, param_file, CS)
This subroutine allocates space for the static variables used by this module. The metrics may be effe...
subroutine, public continuity(u, v, hin, h, uh, vh, dt, G, GV, CS, uhbt, vhbt, OBC, visc_rem_u, visc_rem_v, u_cor, v_cor, uhbt_aux, vhbt_aux, u_cor_aux, v_cor_aux, BT_cont)
Time steps the layer thicknesses, using a monotonically limited, directionally split PPM scheme...
subroutine, public save_restart(directory, time, G, CS, time_stamped, filename, GV)
subroutine, public vertvisc_limit_vel(u, v, h, ADp, CDp, fluxes, visc, dt, G, GV, CS)
Velocity components which exceed a threshold for physically reasonable values are truncated...
The thermo_var_ptrs structure contains pointers to an assortment of thermodynamic fields that may be ...
subroutine, public disable_averaging(diag_cs)
Controls where open boundary conditions are applied.
subroutine, public step_mom_dyn_unsplit(u, v, h, tv, visc, Time_local, dt, fluxes, p_surf_begin, p_surf_end, uh, vh, uhtr, vhtr, eta_av, G, GV, CS, VarMix, MEKE)
ALE control structure.
Definition: MOM_ALE.F90:61
subroutine, public restart_init(param_file, CS, restart_root)
subroutine, public vertvisc(u, v, h, fluxes, visc, dt, OBC, ADp, CDp, G, GV, CS, taux_bot, tauy_bot)
Perform a fully implicit vertical diffusion of momentum. Stress top and bottom boundary conditions ar...
integer function, public register_diag_field(module_name, field_name, axes, init_time, long_name, units, missing_value, range, mask_variant, standard_name, verbose, do_not_log, err_msg, interp_method, tile_count, cmor_field_name, cmor_long_name, cmor_units, cmor_standard_name, cell_methods, x_cell_method, y_cell_method, v_cell_method, conversion, v_extensive)
Returns the "diag_mediator" handle for a group (native, CMOR, z-coord, ...) of diagnostics derived fr...
subroutine, public mom_error(level, message, all_print)
subroutine, public diag_update_remap_grids(diag_cs, alt_h)
Build/update vertical grids for diagnostic remapping.