57 use mom_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
59 use mom_cpu_clock, only : clock_module_driver, clock_module, clock_routine
67 use mom_domains, only : to_south, to_west, to_all, cgrid_ne, scalar_pair
71 use mom_io, only : mom_io_init
75 use mom_time_manager, only :
operator(-),
operator(>),
operator(*),
operator(/)
102 implicit none ;
private 104 #include <MOM_memory.h> 108 real allocable_,
dimension(NIMEMB_PTR_,NJMEM_,NKMEM_) :: &
109 cau, & !< CAu = f*v - u.grad(u) [L T-2 ~> m s-2].
110 pfu, & !< PFu = -dM/dx [L T-2 ~> m s-2].
113 real allocable_,
dimension(NIMEM_,NJMEMB_PTR_,NKMEM_) :: &
114 cav, & !< CAv = -f*u - u.grad(v) [L T-2 ~> m s-2].
115 pfv, & !< PFv = -dM/dy [L T-2 ~> m s-2].
118 real,
pointer,
dimension(:,:) :: taux_bot => null()
120 real,
pointer,
dimension(:,:) :: tauy_bot => null()
123 logical :: use_correct_dt_visc
129 logical :: module_is_initialized = .false.
132 integer :: id_uh = -1, id_vh = -1
133 integer :: id_pfu = -1, id_pfv = -1, id_cau = -1, id_cav = -1
163 type(
ale_cs),
pointer :: ale_csp => null()
174 public step_mom_dyn_unsplit, register_restarts_dyn_unsplit
175 public initialize_dyn_unsplit, end_dyn_unsplit
178 integer :: id_clock_cor, id_clock_pres, id_clock_vertvisc
179 integer :: id_clock_continuity, id_clock_horvisc, id_clock_mom_update
180 integer :: id_clock_pass, id_clock_pass_init
189 subroutine step_mom_dyn_unsplit(u, v, h, tv, visc, Time_local, dt, forces, &
190 p_surf_begin, p_surf_end, uh, vh, uhtr, vhtr, eta_av, G, GV, US, CS, &
195 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(inout) :: u
196 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(inout) :: v
197 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(inout) :: h
202 type(time_type),
intent(in) :: Time_local
204 real,
intent(in) :: dt
206 real,
dimension(:,:),
pointer :: p_surf_begin
208 real,
dimension(:,:),
pointer :: p_surf_end
210 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(inout) :: uh
212 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(inout) :: vh
214 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(inout) :: uhtr
216 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(inout) :: vhtr
218 real,
dimension(SZI_(G),SZJ_(G)),
intent(out) :: eta_av
230 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) :: h_av, hp
231 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)) :: up, upp
232 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)) :: vp, vpp
233 real,
dimension(:,:),
pointer :: p_surf => null()
236 logical :: dyn_p_surf
237 integer :: i, j, k, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz
238 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
239 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
242 h_av(:,:,:) = 0; hp(:,:,:) = 0
243 up(:,:,:) = 0; upp(:,:,:) = 0
244 vp(:,:,:) = 0; vpp(:,:,:) = 0
246 dyn_p_surf =
associated(p_surf_begin) .and.
associated(p_surf_end)
248 call safe_alloc_ptr(p_surf,g%isd,g%ied,g%jsd,g%jed) ; p_surf(:,:) = 0.0
250 p_surf => forces%p_surf
261 call enable_averages(dt, time_local, cs%diag)
262 call cpu_clock_begin(id_clock_horvisc)
263 call horizontal_viscosity(u, v, h, cs%diffu, cs%diffv, meke, varmix, g, gv, us, cs%hor_visc_CSp)
264 call cpu_clock_end(id_clock_horvisc)
265 call disable_averaging(cs%diag)
269 call cpu_clock_begin(id_clock_continuity)
270 call continuity(u, v, h, hp, uh, vh, dt*0.5, g, gv, us, cs%continuity_CSp, obc=cs%OBC)
271 call cpu_clock_end(id_clock_continuity)
272 call pass_var(hp, g%Domain, clock=id_clock_pass)
273 call pass_vector(uh, vh, g%Domain, clock=id_clock_pass)
275 call enable_averages(0.5*dt, time_local-real_to_time(0.5*us%T_to_s*dt), cs%diag)
277 if (cs%id_uh > 0)
call post_data(cs%id_uh, uh, cs%diag)
278 if (cs%id_vh > 0)
call post_data(cs%id_vh, vh, cs%diag)
279 call disable_averaging(cs%diag)
283 call cpu_clock_begin(id_clock_mom_update)
285 do j=js-2,je+2 ;
do i=is-2,ie+2
286 h_av(i,j,k) = (h(i,j,k) + hp(i,j,k)) * 0.5
288 do j=js,je ;
do i=isq,ieq
289 u(i,j,k) = u(i,j,k) + dt * cs%diffu(i,j,k) * g%mask2dCu(i,j)
291 do j=jsq,jeq ;
do i=is,ie
292 v(i,j,k) = v(i,j,k) + dt * cs%diffv(i,j,k) * g%mask2dCv(i,j)
294 do j=js-2,je+2 ;
do i=isq-2,ieq+2
295 uhtr(i,j,k) = uhtr(i,j,k) + 0.5*dt*uh(i,j,k)
297 do j=jsq-2,jeq+2 ;
do i=is-2,ie+2
298 vhtr(i,j,k) = vhtr(i,j,k) + 0.5*dt*vh(i,j,k)
301 call cpu_clock_end(id_clock_mom_update)
302 call pass_vector(u, v, g%Domain, clock=id_clock_pass)
305 call cpu_clock_begin(id_clock_cor)
306 call coradcalc(u, v, h_av, uh, vh, cs%CAu, cs%CAv, cs%OBC, cs%ADp, &
307 g, gv, us, cs%CoriolisAdv_CSp)
308 call cpu_clock_end(id_clock_cor)
311 call cpu_clock_begin(id_clock_pres)
312 if (dyn_p_surf)
then ;
do j=js-2,je+2 ;
do i=is-2,ie+2
313 p_surf(i,j) = 0.75*p_surf_begin(i,j) + 0.25*p_surf_end(i,j)
314 enddo ;
enddo ;
endif 315 call pressureforce(h_av, tv, cs%PFu, cs%PFv, g, gv, us, &
316 cs%PressureForce_CSp, cs%ALE_CSp, p_surf)
317 call cpu_clock_end(id_clock_pres)
319 if (
associated(cs%OBC)) then;
if (cs%OBC%update_OBC)
then 320 call update_obc_data(cs%OBC, g, gv, us, tv, h, cs%update_OBC_CSp, time_local)
322 if (
associated(cs%OBC))
then 323 call open_boundary_zero_normal_flow(cs%OBC, g, cs%PFu, cs%PFv)
324 call open_boundary_zero_normal_flow(cs%OBC, g, cs%CAu, cs%CAv)
328 call cpu_clock_begin(id_clock_mom_update)
329 do k=1,nz ;
do j=js,je ;
do i=isq,ieq
330 up(i,j,k) = g%mask2dCu(i,j) * (u(i,j,k) + dt_pred * (cs%PFu(i,j,k) + cs%CAu(i,j,k)))
331 enddo ;
enddo ;
enddo 332 do k=1,nz ;
do j=jsq,jeq ;
do i=is,ie
333 vp(i,j,k) = g%mask2dCv(i,j) * (v(i,j,k) + dt_pred * (cs%PFv(i,j,k) + cs%CAv(i,j,k)))
334 enddo ;
enddo ;
enddo 335 call cpu_clock_end(id_clock_mom_update)
339 call mom_accel_chksum(
"Predictor 1 accel", cs%CAu, cs%CAv, cs%PFu, cs%PFv, &
340 cs%diffu, cs%diffv, g, gv, us)
344 call cpu_clock_begin(id_clock_vertvisc)
345 call enable_averages(dt, time_local, cs%diag)
346 dt_visc = 0.5*dt ;
if (cs%use_correct_dt_visc) dt_visc = dt
347 call set_viscous_ml(u, v, h_av, tv, forces, visc, dt_visc, g, gv, us, cs%set_visc_CSp)
348 call disable_averaging(cs%diag)
350 dt_visc = 0.5*dt ;
if (cs%use_correct_dt_visc) dt_visc = dt_pred
351 call vertvisc_coef(up, vp, h_av, forces, visc, dt_visc, g, gv, us, cs%vertvisc_CSp, cs%OBC)
352 call vertvisc(up, vp, h_av, forces, visc, dt_visc, cs%OBC, cs%ADp, cs%CDp, &
353 g, gv, us, cs%vertvisc_CSp, waves=waves)
354 call cpu_clock_end(id_clock_vertvisc)
355 call pass_vector(up, vp, g%Domain, clock=id_clock_pass)
359 call cpu_clock_begin(id_clock_continuity)
360 call continuity(up, vp, hp, h_av, uh, vh, (0.5*dt), g, gv, us, cs%continuity_CSp, obc=cs%OBC)
361 call cpu_clock_end(id_clock_continuity)
362 call pass_var(h_av, g%Domain, clock=id_clock_pass)
363 call pass_vector(uh, vh, g%Domain, clock=id_clock_pass)
366 do k=1,nz ;
do j=js-2,je+2 ;
do i=is-2,ie+2
367 h_av(i,j,k) = (hp(i,j,k) + h_av(i,j,k)) * 0.5
368 enddo ;
enddo ;
enddo 371 call cpu_clock_begin(id_clock_cor)
372 call coradcalc(up, vp, h_av, uh, vh, cs%CAu, cs%CAv, cs%OBC, cs%ADp, &
373 g, gv, us, cs%CoriolisAdv_CSp)
374 call cpu_clock_end(id_clock_cor)
377 call cpu_clock_begin(id_clock_pres)
378 if (dyn_p_surf)
then ;
do j=js-2,je+2 ;
do i=is-2,ie+2
379 p_surf(i,j) = 0.25*p_surf_begin(i,j) + 0.75*p_surf_end(i,j)
380 enddo ;
enddo ;
endif 381 call pressureforce(h_av, tv, cs%PFu, cs%PFv, g, gv, us, &
382 cs%PressureForce_CSp, cs%ALE_CSp, p_surf)
383 call cpu_clock_end(id_clock_pres)
385 if (
associated(cs%OBC)) then;
if (cs%OBC%update_OBC)
then 386 call update_obc_data(cs%OBC, g, gv, us, tv, h, cs%update_OBC_CSp, time_local)
388 if (
associated(cs%OBC))
then 389 call open_boundary_zero_normal_flow(cs%OBC, g, cs%PFu, cs%PFv)
390 call open_boundary_zero_normal_flow(cs%OBC, g, cs%CAu, cs%CAv)
394 call cpu_clock_begin(id_clock_mom_update)
395 do k=1,nz ;
do j=js,je ;
do i=isq,ieq
396 upp(i,j,k) = g%mask2dCu(i,j) * (u(i,j,k) + dt * 0.5 * (cs%PFu(i,j,k) + cs%CAu(i,j,k)))
397 enddo ;
enddo ;
enddo 398 do k=1,nz ;
do j=jsq,jeq ;
do i=is,ie
399 vpp(i,j,k) = g%mask2dCv(i,j) * (v(i,j,k) + dt * 0.5 * (cs%PFv(i,j,k) + cs%CAv(i,j,k)))
400 enddo ;
enddo ;
enddo 401 call cpu_clock_end(id_clock_mom_update)
404 call mom_state_chksum(
"Predictor 2", upp, vpp, h_av, uh, vh, g, gv, us)
405 call mom_accel_chksum(
"Predictor 2 accel", cs%CAu, cs%CAv, cs%PFu, cs%PFv, &
406 cs%diffu, cs%diffv, g, gv, us)
410 call cpu_clock_begin(id_clock_vertvisc)
411 call vertvisc_coef(upp, vpp, hp, forces, visc, dt*0.5, g, gv, us, cs%vertvisc_CSp, cs%OBC)
412 call vertvisc(upp, vpp, hp, forces, visc, dt*0.5, cs%OBC, cs%ADp, cs%CDp, &
413 g, gv, us, cs%vertvisc_CSp, waves=waves)
414 call cpu_clock_end(id_clock_vertvisc)
415 call pass_vector(upp, vpp, g%Domain, clock=id_clock_pass)
419 call cpu_clock_begin(id_clock_continuity)
420 call continuity(upp, vpp, hp, h, uh, vh, (dt*0.5), g, gv, us, cs%continuity_CSp, obc=cs%OBC)
421 call cpu_clock_end(id_clock_continuity)
422 call pass_var(h, g%Domain, clock=id_clock_pass)
423 call pass_vector(uh, vh, g%Domain, clock=id_clock_pass)
426 call diag_update_remap_grids(cs%diag)
428 call enable_averages(0.5*dt, time_local, cs%diag)
430 if (cs%id_uh > 0)
call post_data(cs%id_uh, uh, cs%diag)
431 if (cs%id_vh > 0)
call post_data(cs%id_vh, vh, cs%diag)
432 call disable_averaging(cs%diag)
433 call enable_averages(dt, time_local, cs%diag)
437 do j=js-2,je+2 ;
do i=is-2,ie+2
438 h_av(i,j,k) = 0.5*(h(i,j,k) + hp(i,j,k))
440 do j=js-2,je+2 ;
do i=isq-2,ieq+2
441 uhtr(i,j,k) = uhtr(i,j,k) + 0.5*dt*uh(i,j,k)
443 do j=jsq-2,jeq+2 ;
do i=is-2,ie+2
444 vhtr(i,j,k) = vhtr(i,j,k) + 0.5*dt*vh(i,j,k)
449 call cpu_clock_begin(id_clock_cor)
450 call coradcalc(upp, vpp, h_av, uh, vh, cs%CAu, cs%CAv, cs%OBC, cs%ADp, &
451 g, gv, us, cs%CoriolisAdv_CSp)
452 call cpu_clock_end(id_clock_cor)
455 call cpu_clock_begin(id_clock_pres)
456 call pressureforce(h_av, tv, cs%PFu, cs%PFv, g, gv, us, &
457 cs%PressureForce_CSp, cs%ALE_CSp, p_surf)
458 call cpu_clock_end(id_clock_pres)
460 if (
associated(cs%OBC)) then;
if (cs%OBC%update_OBC)
then 461 call update_obc_data(cs%OBC, g, gv, us, tv, h, cs%update_OBC_CSp, time_local)
465 if (
associated(cs%OBC))
then 466 call open_boundary_zero_normal_flow(cs%OBC, g, cs%PFu, cs%PFv)
467 call open_boundary_zero_normal_flow(cs%OBC, g, cs%CAu, cs%CAv)
469 do k=1,nz ;
do j=js,je ;
do i=isq,ieq
470 u(i,j,k) = g%mask2dCu(i,j) * (u(i,j,k) + dt * (cs%PFu(i,j,k) + cs%CAu(i,j,k)))
471 enddo ;
enddo ;
enddo 472 do k=1,nz ;
do j=jsq,jeq ;
do i=is,ie
473 v(i,j,k) = g%mask2dCv(i,j) * (v(i,j,k) + dt * (cs%PFv(i,j,k) + cs%CAv(i,j,k)))
474 enddo ;
enddo ;
enddo 477 call cpu_clock_begin(id_clock_vertvisc)
478 call vertvisc_coef(u, v, h_av, forces, visc, dt, g, gv, us, cs%vertvisc_CSp, cs%OBC)
479 call vertvisc(u, v, h_av, forces, visc, dt, cs%OBC, cs%ADp, cs%CDp, &
480 g, gv, us, cs%vertvisc_CSp, cs%taux_bot, cs%tauy_bot, waves=waves)
481 call cpu_clock_end(id_clock_vertvisc)
482 call pass_vector(u, v, g%Domain, clock=id_clock_pass)
485 call mom_state_chksum(
"Corrector", u, v, h, uh, vh, g, gv, us)
486 call mom_accel_chksum(
"Corrector accel", cs%CAu, cs%CAv, cs%PFu, cs%PFv, &
487 cs%diffu, cs%diffv, g, gv, us)
490 if (gv%Boussinesq)
then 491 do j=js,je ;
do i=is,ie ; eta_av(i,j) = -gv%Z_to_H*g%bathyT(i,j) ;
enddo ;
enddo 493 do j=js,je ;
do i=is,ie ; eta_av(i,j) = 0.0 ;
enddo ;
enddo 495 do k=1,nz ;
do j=js,je ;
do i=is,ie
496 eta_av(i,j) = eta_av(i,j) + h_av(i,j,k)
497 enddo ;
enddo ;
enddo 499 if (dyn_p_surf)
deallocate(p_surf)
503 if (cs%id_PFu > 0)
call post_data(cs%id_PFu, cs%PFu, cs%diag)
504 if (cs%id_PFv > 0)
call post_data(cs%id_PFv, cs%PFv, cs%diag)
505 if (cs%id_CAu > 0)
call post_data(cs%id_CAu, cs%CAu, cs%diag)
506 if (cs%id_CAv > 0)
call post_data(cs%id_CAv, cs%CAv, cs%diag)
508 end subroutine step_mom_dyn_unsplit
517 subroutine register_restarts_dyn_unsplit(HI, GV, param_file, CS, restart_CS)
518 type(hor_index_type),
intent(in) :: HI
519 type(verticalgrid_type),
intent(in) :: GV
520 type(param_file_type),
intent(in) :: param_file
524 type(mom_restart_cs),
pointer :: restart_CS
527 character(len=40) :: mdl =
"MOM_dynamics_unsplit" 528 character(len=48) :: thickness_units, flux_units
529 integer :: isd, ied, jsd, jed, nz, IsdB, IedB, JsdB, JedB
530 isd = hi%isd ; ied = hi%ied ; jsd = hi%jsd ; jed = hi%jed ; nz = gv%ke
531 isdb = hi%IsdB ; iedb = hi%IedB ; jsdb = hi%JsdB ; jedb = hi%JedB
534 if (
associated(cs))
then 535 call mom_error(warning,
"register_restarts_dyn_unsplit called with an associated "// &
536 "control structure.")
541 alloc_(cs%diffu(isdb:iedb,jsd:jed,nz)) ; cs%diffu(:,:,:) = 0.0
542 alloc_(cs%diffv(isd:ied,jsdb:jedb,nz)) ; cs%diffv(:,:,:) = 0.0
543 alloc_(cs%CAu(isdb:iedb,jsd:jed,nz)) ; cs%CAu(:,:,:) = 0.0
544 alloc_(cs%CAv(isd:ied,jsdb:jedb,nz)) ; cs%CAv(:,:,:) = 0.0
545 alloc_(cs%PFu(isdb:iedb,jsd:jed,nz)) ; cs%PFu(:,:,:) = 0.0
546 alloc_(cs%PFv(isd:ied,jsdb:jedb,nz)) ; cs%PFv(:,:,:) = 0.0
548 thickness_units = get_thickness_units(gv)
549 flux_units = get_flux_units(gv)
553 end subroutine register_restarts_dyn_unsplit
556 subroutine initialize_dyn_unsplit(u, v, h, Time, G, GV, US, param_file, diag, CS, &
557 restart_CS, Accel_diag, Cont_diag, MIS, MEKE, &
558 OBC, update_OBC_CSp, ALE_CSp, setVisc_CSp, &
559 visc, dirs, ntrunc, cont_stencil)
560 type(ocean_grid_type),
intent(inout) :: G
561 type(verticalgrid_type),
intent(in) :: GV
562 type(unit_scale_type),
intent(in) :: US
563 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
565 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)), &
567 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) , &
569 type(time_type),
target,
intent(in) :: Time
570 type(param_file_type),
intent(in) :: param_file
572 type(diag_ctrl),
target,
intent(inout) :: diag
576 type(mom_restart_cs),
pointer :: restart_CS
578 type(accel_diag_ptrs),
target,
intent(inout) :: Accel_diag
581 type(cont_diag_ptrs),
target,
intent(inout) :: Cont_diag
584 type(ocean_internal_state),
intent(inout) :: MIS
587 type(meke_type),
pointer :: MEKE
588 type(ocean_obc_type),
pointer :: OBC
591 type(update_obc_cs),
pointer :: update_OBC_CSp
594 type(ale_cs),
pointer :: ALE_CSp
596 type(set_visc_cs),
pointer :: setVisc_CSp
598 type(vertvisc_type),
intent(inout) :: visc
601 type(directories),
intent(in) :: dirs
603 integer,
target,
intent(inout) :: ntrunc
606 integer,
optional,
intent(out) :: cont_stencil
613 character(len=40) :: mdl =
"MOM_dynamics_unsplit" 614 character(len=48) :: thickness_units, flux_units
616 # include "version_variable.h" 619 integer :: isd, ied, jsd, jed, nz, IsdB, IedB, JsdB, JedB
620 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed ; nz = g%ke
621 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
623 if (.not.
associated(cs))
call mom_error(fatal, &
624 "initialize_dyn_unsplit called with an unassociated control structure.")
625 if (cs%module_is_initialized)
then 626 call mom_error(warning,
"initialize_dyn_unsplit called with a control "// &
627 "structure that has already been initialized.")
630 cs%module_is_initialized = .true.
634 call log_version(param_file, mdl, version,
"")
635 call get_param(param_file, mdl,
"FIX_UNSPLIT_DT_VISC_BUG", cs%use_correct_dt_visc, &
636 "If true, use the correct timestep in the viscous terms applied in the first "//&
637 "predictor step with the unsplit time stepping scheme, and in the calculation "//&
638 "of the turbulent mixed layer properties for viscosity with unsplit or "//&
639 "unsplit_RK2.", default=.true.)
640 call get_param(param_file, mdl,
"DEBUG", cs%debug, &
641 "If true, write out verbose debugging data.", &
642 default=.false., debuggingparam=.true.)
643 call get_param(param_file, mdl,
"TIDES", use_tides, &
644 "If true, apply tidal momentum forcing.", default=.false.)
646 allocate(cs%taux_bot(isdb:iedb,jsd:jed)) ; cs%taux_bot(:,:) = 0.0
647 allocate(cs%tauy_bot(isd:ied,jsdb:jedb)) ; cs%tauy_bot(:,:) = 0.0
649 mis%diffu => cs%diffu ; mis%diffv => cs%diffv
650 mis%PFu => cs%PFu ; mis%PFv => cs%PFv
651 mis%CAu => cs%CAu ; mis%CAv => cs%CAv
653 cs%ADp => accel_diag ; cs%CDp => cont_diag
654 accel_diag%diffu => cs%diffu ; accel_diag%diffv => cs%diffv
655 accel_diag%PFu => cs%PFu ; accel_diag%PFv => cs%PFv
656 accel_diag%CAu => cs%CAu ; accel_diag%CAv => cs%CAv
658 call continuity_init(time, g, gv, us, param_file, diag, cs%continuity_CSp)
659 if (
present(cont_stencil)) cont_stencil = continuity_stencil(cs%continuity_CSp)
660 call coriolisadv_init(time, g, gv, us, param_file, diag, cs%ADp, cs%CoriolisAdv_CSp)
661 if (use_tides)
call tidal_forcing_init(time, g, param_file, cs%tides_CSp)
662 call pressureforce_init(time, g, gv, us, param_file, diag, cs%PressureForce_CSp, &
664 call hor_visc_init(time, g, us, param_file, diag, cs%hor_visc_CSp, meke)
665 call vertvisc_init(mis, time, g, gv, us, param_file, diag, cs%ADp, dirs, &
666 ntrunc, cs%vertvisc_CSp)
667 if (.not.
associated(setvisc_csp))
call mom_error(fatal, &
668 "initialize_dyn_unsplit called with setVisc_CSp unassociated.")
669 cs%set_visc_CSp => setvisc_csp
671 if (
associated(ale_csp)) cs%ALE_CSp => ale_csp
672 if (
associated(obc)) cs%OBC => obc
673 if (
associated(update_obc_csp)) cs%update_OBC_CSp => update_obc_csp
675 flux_units = get_flux_units(gv)
676 h_convert = gv%H_to_m ;
if (.not.gv%Boussinesq) h_convert = gv%H_to_kg_m2
677 cs%id_uh = register_diag_field(
'ocean_model',
'uh', diag%axesCuL, time, &
678 'Zonal Thickness Flux', flux_units, y_cell_method=
'sum', v_extensive=.true., &
679 conversion=h_convert*us%L_to_m**2*us%s_to_T)
680 cs%id_vh = register_diag_field(
'ocean_model',
'vh', diag%axesCvL, time, &
681 'Meridional Thickness Flux', flux_units, x_cell_method=
'sum', v_extensive=.true., &
682 conversion=h_convert*us%L_to_m**2*us%s_to_T)
683 cs%id_CAu = register_diag_field(
'ocean_model',
'CAu', diag%axesCuL, time, &
684 'Zonal Coriolis and Advective Acceleration',
'm s-2', &
685 conversion=us%L_T2_to_m_s2)
686 cs%id_CAv = register_diag_field(
'ocean_model',
'CAv', diag%axesCvL, time, &
687 'Meridional Coriolis and Advective Acceleration',
'm s-2', &
688 conversion=us%L_T2_to_m_s2)
689 cs%id_PFu = register_diag_field(
'ocean_model',
'PFu', diag%axesCuL, time, &
690 'Zonal Pressure Force Acceleration',
'm s-2', &
691 conversion=us%L_T2_to_m_s2)
692 cs%id_PFv = register_diag_field(
'ocean_model',
'PFv', diag%axesCvL, time, &
693 'Meridional Pressure Force Acceleration',
'm s-2', &
694 conversion=us%L_T2_to_m_s2)
696 id_clock_cor = cpu_clock_id(
'(Ocean Coriolis & mom advection)', grain=clock_module)
697 id_clock_continuity = cpu_clock_id(
'(Ocean continuity equation)', grain=clock_module)
698 id_clock_pres = cpu_clock_id(
'(Ocean pressure force)', grain=clock_module)
699 id_clock_vertvisc = cpu_clock_id(
'(Ocean vertical viscosity)', grain=clock_module)
700 id_clock_horvisc = cpu_clock_id(
'(Ocean horizontal viscosity)', grain=clock_module)
701 id_clock_mom_update = cpu_clock_id(
'(Ocean momentum increments)', grain=clock_module)
702 id_clock_pass = cpu_clock_id(
'(Ocean message passing)', grain=clock_module)
703 id_clock_pass_init = cpu_clock_id(
'(Ocean init message passing)', grain=clock_routine)
705 end subroutine initialize_dyn_unsplit
708 subroutine end_dyn_unsplit(CS)
712 dealloc_(cs%diffu) ; dealloc_(cs%diffv)
713 dealloc_(cs%CAu) ; dealloc_(cs%CAv)
714 dealloc_(cs%PFu) ; dealloc_(cs%PFv)
717 end subroutine end_dyn_unsplit
Calculates the heights of sruface or all interfaces from layer thicknesses.
Wraps the FMS time manager functions.
Time steps the ocean dynamics with an unsplit quasi 3rd order scheme.
This module contains the main regridding routines.
The control structure for the MOM_boundary_update module.
This module implements boundary forcing for MOM6.
Complete a halo update on a pair of arrays representing the two components of a vector.
Control structure for horizontal viscosity.
Functions for calculating interface heights, including free surface height.
Calculates horizontal viscosity and viscous stresses.
Ocean grid type. See mom_grid for details.
Solve the layer continuity equation.
Controls where open boundary conditions are applied.
A structure that can be parsed to read and document run-time parameters.
Implements vertical viscosity (vertvisc)
Provides the ocean grid type.
Vertical viscosities, drag coefficients, and related fields.
Complete a non-blocking halo update on an array.
Wraps the MPP cpu clock functions.
Register fields for restarts.
Accelerations due to the Coriolis force and momentum advection.
Control structure for MOM_set_visc.
A thin wrapper for Boussinesq/non-Boussinesq forms of the pressure force calculation.
This type is used to exchange information related to the MEKE calculations.
This module contains I/O framework code.
Calculates various values related to the bottom boundary layer, such as the viscosity and thickness o...
The MOM6 facility to parse input files for runtime parameters.
Defines the horizontal index type (hor_index_type) used for providing index ranges.
Initiate a non-blocking halo update on an array.
Pointers to arrays with accelerations, which can later be used for derived diagnostics, like energy balances.
Variable mixing coefficients.
Do a halo update on a pair of arrays representing the two components of a vector. ...
Container for horizontal index ranges for data, computational and global domains. ...
Control structure for mom_coriolisadv.
Structure that contains pointers to the mechanical forcing at the surface used to drive the liquid oc...
Variable mixing coefficients.
Interface for surface waves.
Make a diagnostic available for averaging or output.
A restart registry and the control structure for restarts.
Describes various unit conversion factors.
Control structure for mom_continuity.
Initiate a halo update on a pair of arrays representing the two components of a vector.
Provides routines that do checksums of groups of MOM variables.
Tidal contributions to geopotential.
Provides a transparent unit rescaling type to facilitate dimensional consistency testing.
Describes the decomposed MOM domain and has routines for communications across PEs.
Thickness diffusion (or Gent McWilliams)
Pointers to arrays with transports, which can later be used for derived diagnostics, like energy balances.
Routines for error handling and I/O management.
The MOM6 facility for reading and writing restart files, and querying what has been read...
Pointers to all of the prognostic variables allocated in MOM_variables.F90 and MOM.F90.
Container for all surface wave related parameters.
The control structure with parameters and memory for the MOM_vert_friction module.
An overloaded interface to log version information about modules.
Describes the vertical ocean grid, including unit conversion factors.
MOM_dynamics_unsplit module control structure.
Check for consistency between the duplicated points of a C-grid vector.
Pointers to an assortment of thermodynamic fields that may be available, including potential temperat...
The control structure for the MOM_tidal_forcing module.
Control structure for thickness diffusion.
Indicate whether a field has been read from a restart file.
The barotropic stepping control stucture.
Controls where open boundary conditions are applied.
Provides a transparent vertical ocean grid type and supporting routines.
Provides transparent structures with groups of MOM6 variables and supporting routines.
Pressure force control structure.
Do a halo update on an array.
Write out checksums of the MOM6 state variables.
An overloaded interface to read and log the values of various types of parameters.
Provides checksumming functions for debugging.