12 use mom_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
14 use mom_cpu_clock, only : clock_module_driver, clock_module, clock_routine
21 use mom_domains, only : to_north, to_east, omit_corners
33 use mom_time_manager, only : time_type, set_time, time_type_to_real,
operator(+)
34 use mom_time_manager, only :
operator(-),
operator(>),
operator(*),
operator(/)
62 implicit none ;
private 64 #include <MOM_memory.h> 68 real allocable_,
dimension(NIMEMB_PTR_,NJMEM_,NKMEM_) :: &
69 cau, & !< CAu = f*v - u.grad(u) in m s-2.
70 pfu, & !< PFu = -dM/dx, in m s-2.
71 diffu, & !< Zonal acceleration due to convergence of the along-isopycnal
81 real allocable_,
dimension(NIMEM_,NJMEMB_PTR_,NKMEM_) :: &
82 cav, & !< CAv = -f*u - u.grad(v) in m s-2.
83 pfv, & !< PFv = -dM/dy, in m s-2.
84 diffv, & !< Meridional acceleration due to convergence of the
96 real allocable_,
dimension(NIMEM_,NJMEM_) :: eta
97 real allocable_,
dimension(NIMEMB_PTR_,NJMEM_,NKMEM_) :: u_av
99 real allocable_,
dimension(NIMEM_,NJMEMB_PTR_,NKMEM_) :: v_av
101 real allocable_,
dimension(NIMEM_,NJMEM_,NKMEM_) :: h_av
102 real allocable_,
dimension(NIMEM_,NJMEM_) :: eta_pf
103 real allocable_,
dimension(NIMEMB_PTR_,NJMEM_) :: uhbt
105 real allocable_,
dimension(NIMEM_,NJMEMB_PTR_) :: vhbt
107 real allocable_,
dimension(NIMEM_,NJMEM_,NKMEM_) :: pbce
110 real,
pointer,
dimension(:,:) :: taux_bot => null()
111 real,
pointer,
dimension(:,:) :: tauy_bot => null()
118 logical :: bt_use_layer_fluxes
121 logical :: split_bottom_stress
135 logical :: module_is_initialized = .false.
137 integer :: id_uh = -1, id_vh = -1
138 integer :: id_umo = -1, id_vmo = -1
139 integer :: id_umo_2d = -1, id_vmo_2d = -1
140 integer :: id_pfu = -1, id_pfv = -1
141 integer :: id_cau = -1, id_cav = -1
144 integer :: id_uav = -1, id_vav = -1
145 integer :: id_u_bt_accel = -1, id_v_bt_accel = -1
175 type(
ale_cs),
pointer :: ale_csp => null()
178 type(group_pass_type) :: pass_eta
179 type(group_pass_type) :: pass_visc_rem, pass_uvp
180 type(group_pass_type) :: pass_hp_uv
181 type(group_pass_type) :: pass_uv
182 type(group_pass_type) :: pass_h, pass_av_uvh
202 Time_local, dt, fluxes, p_surf_begin, p_surf_end, &
203 dt_since_flux, dt_therm, uh, vh, uhtr, vhtr, eta_av, &
204 G, GV, CS, calc_dtbt, VarMix, MEKE)
207 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
target,
intent(inout) :: u
208 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
target,
intent(inout) :: v
209 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(inout) :: h
212 type(time_type),
intent(in) :: Time_local
213 real,
intent(in) :: dt
214 type(
forcing),
intent(in) :: fluxes
215 real,
dimension(:,:),
pointer :: p_surf_begin
216 real,
dimension(:,:),
pointer :: p_surf_end
217 real,
intent(in) :: dt_since_flux
218 real,
intent(in) :: dt_therm
219 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
target,
intent(inout) :: uh
220 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
target,
intent(inout) :: vh
221 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(inout) :: uhtr
222 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(inout) :: vhtr
223 real,
dimension(SZI_(G),SZJ_(G)),
intent(out) :: eta_av
225 logical,
intent(in) :: calc_dtbt
231 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)) :: up
232 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)) :: vp
233 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) :: hp
235 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)) :: u_bc_accel
236 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)) :: v_bc_accel
240 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
target :: uh_in
241 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
target :: vh_in
245 real,
dimension(SZIB_(G),SZJ_(G)) :: uhbt_out
246 real,
dimension(SZI_(G),SZJB_(G)) :: vhbt_out
250 real,
dimension(SZI_(G),SZJ_(G)) :: eta_pred
254 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
target :: u_adj
255 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
target :: v_adj
260 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)) :: u_old_rad_OBC
261 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)) :: v_old_rad_OBC
266 real,
pointer,
dimension(:,:) :: &
267 p_surf => null(), eta_pf_start => null(), &
268 taux_bot => null(), tauy_bot => null(), &
271 real,
pointer,
dimension(:,:,:) :: &
272 uh_ptr => null(), u_ptr => null(), vh_ptr => null(), v_ptr => null(), &
273 u_init => null(), v_init => null(), &
279 logical :: dyn_p_surf
280 logical :: BT_cont_BT_thick
284 logical :: showCallTree, sym
286 integer :: i, j, k, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz
287 integer :: cont_stencil
288 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
289 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
290 u_av => cs%u_av ; v_av => cs%v_av ; h_av => cs%h_av ; eta => cs%eta
293 sym=.false.;
if (g%Domain%symmetric) sym=.true.
295 showcalltree = calltree_showquery()
296 if (showcalltree)
call calltree_enter(
"step_MOM_dyn_split_RK2(), MOM_dynamics_split_RK2.F90")
300 do j=g%jsd,g%jed ;
do i=g%isdB,g%iedB ; up(i,j,k) = 0.0 ;
enddo ;
enddo 301 do j=g%jsdB,g%jedB ;
do i=g%isd,g%ied ; vp(i,j,k) = 0.0 ;
enddo ;
enddo 302 do j=g%jsd,g%jed ;
do i=g%isd,g%ied ; hp(i,j,k) = h(i,j,k) ;
enddo ;
enddo 309 call mom_state_chksum(
"Start predictor ", u, v, h, uh, vh, g, gv, symmetric=sym)
314 dyn_p_surf =
associated(p_surf_begin) .and.
associated(p_surf_end)
317 call safe_alloc_ptr(eta_pf_start,g%isd,g%ied,g%jsd,g%jed)
318 eta_pf_start(:,:) = 0.0
320 p_surf => fluxes%p_surf
323 if (
associated(cs%OBC))
then 324 do k=1,nz ;
do j=js-1,je+1 ;
do i=is-2,ie+1
325 u_old_rad_obc(i,j,k) = u_av(i,j,k)
326 enddo ;
enddo ;
enddo 327 do k=1,nz ;
do j=js-2,je+1 ;
do i=is-1,ie+1
328 v_old_rad_obc(i,j,k) = v_av(i,j,k)
329 enddo ;
enddo ;
enddo 332 bt_cont_bt_thick = .false.
333 if (
associated(cs%BT_cont)) bt_cont_bt_thick = &
334 (
associated(cs%BT_cont%h_u) .and.
associated(cs%BT_cont%h_v))
336 if (cs%split_bottom_stress)
then 337 taux_bot => cs%taux_bot ; tauy_bot => cs%tauy_bot
347 call create_group_pass(cs%pass_visc_rem, cs%visc_rem_u, cs%visc_rem_v, g%Domain, &
348 to_all+scalar_pair, cgrid_ne, halo=max(1,cont_stencil))
364 if (cs%begw == 0.0)
call enable_averaging(dt, time_local, cs%diag)
366 call pressureforce(h, tv, cs%PFu, cs%PFv, g, gv, cs%PressureForce_CSp, &
367 cs%ALE_CSp, p_surf, cs%pbce, cs%eta_PF)
369 pa_to_eta = 1.0 / gv%H_to_Pa
371 do j=jsq,jeq+1 ;
do i=isq,ieq+1
372 eta_pf_start(i,j) = cs%eta_PF(i,j) - pa_to_eta * &
373 (p_surf_begin(i,j) - p_surf_end(i,j))
377 call disable_averaging(cs%diag)
378 if (showcalltree)
call calltree_waypoint(
"done with PressureForce (step_MOM_dyn_split_RK2)")
380 if (
associated(cs%OBC)) then;
if (cs%OBC%update_OBC)
then 381 call update_obc_data(cs%OBC, g, gv, tv, h, cs%update_OBC_CSp, time_local)
384 if (g%nonblocking_updates)
then 392 call coradcalc(u_av, v_av, h_av, uh, vh, cs%CAu, cs%CAv, cs%OBC, cs%ADp, &
393 g, gv, cs%CoriolisAdv_CSp)
395 if (showcalltree)
call calltree_waypoint(
"done with CorAdCalc (step_MOM_dyn_split_RK2)")
401 do j=js,je ;
do i=isq,ieq
402 u_bc_accel(i,j,k) = (cs%Cau(i,j,k) + cs%PFu(i,j,k)) + cs%diffu(i,j,k)
404 do j=jsq,jeq ;
do i=is,ie
405 v_bc_accel(i,j,k) = (cs%Cav(i,j,k) + cs%PFv(i,j,k)) + cs%diffv(i,j,k)
408 if (
associated(cs%OBC))
then 415 cs%diffu, cs%diffv, g, gv, cs%pbce, u_bc_accel, v_bc_accel, &
420 call check_redundant(
"pre-btstep u_bc_accel ", u_bc_accel, v_bc_accel, g)
426 do j=js,je ;
do i=isq,ieq
427 up(i,j,k) = g%mask2dCu(i,j) * (u(i,j,k) + dt * u_bc_accel(i,j,k))
429 do j=jsq,jeq ;
do i=is,ie
430 vp(i,j,k) = g%mask2dCv(i,j) * (v(i,j,k) + dt * v_bc_accel(i,j,k))
434 call enable_averaging(dt, time_local, cs%diag)
437 call disable_averaging(cs%diag)
440 call uvchksum(
"before vertvisc: up", up, vp, g%HI, haloshift=0, symmetric=sym)
442 call vertvisc_coef(up, vp, h, fluxes, visc, dt, g, gv, cs%vertvisc_CSp, cs%OBC)
443 call vertvisc_remnant(visc, cs%visc_rem_u, cs%visc_rem_v, dt, g, gv, cs%vertvisc_CSp)
445 if (showcalltree)
call calltree_waypoint(
"done with vertvisc_coef (step_MOM_dyn_split_RK2)")
449 if (g%nonblocking_updates)
then 453 call do_group_pass(cs%pass_eta, g%Domain)
454 call do_group_pass(cs%pass_visc_rem, g%Domain)
460 if (.not.bt_cont_bt_thick) &
461 call btcalc(h, g, gv, cs%barotropic_CSp, obc=cs%OBC)
462 call bt_mass_source(h, eta, fluxes, .true., dt_therm, dt_since_flux, &
463 g, gv, cs%barotropic_CSp)
466 if (g%nonblocking_updates)
then 473 if (
associated(cs%BT_cont) .or. cs%BT_use_layer_fluxes)
then 475 call continuity(u, v, h, hp, uh_in, vh_in, dt, g, gv, &
476 cs%continuity_CSp, obc=cs%OBC, visc_rem_u=cs%visc_rem_u, &
477 visc_rem_v=cs%visc_rem_v, bt_cont=cs%BT_cont)
479 if (bt_cont_bt_thick)
then 480 call btcalc(h, g, gv, cs%barotropic_CSp, cs%BT_cont%h_u, cs%BT_cont%h_v, &
483 if (showcalltree)
call calltree_waypoint(
"done with continuity[BT_cont] (step_MOM_dyn_split_RK2)")
486 if (cs%BT_use_layer_fluxes)
then 487 uh_ptr => uh_in; vh_ptr => vh_in; u_ptr => u; v_ptr => v
490 u_init => u ; v_init => v
492 if (calc_dtbt)
call set_dtbt(g, gv, cs%barotropic_CSp, eta, cs%pbce)
493 if (showcalltree)
call calltree_enter(
"btstep(), MOM_barotropic.F90")
495 call btstep(u, v, eta, dt, u_bc_accel, v_bc_accel, &
496 fluxes, cs%pbce, cs%eta_PF, u_av, v_av, cs%u_accel_bt, &
497 cs%v_accel_bt, eta_pred, cs%uhbt, cs%vhbt, g, gv, cs%barotropic_CSp,&
498 cs%visc_rem_u, cs%visc_rem_v, obc=cs%OBC, &
499 bt_cont = cs%BT_cont, eta_pf_start=eta_pf_start, &
500 taux_bot=taux_bot, tauy_bot=tauy_bot, &
501 uh0=uh_ptr, vh0=vh_ptr, u_uh0=u_ptr, v_vh0=v_ptr)
511 do j=jsq,jeq ;
do i=is,ie
512 vp(i,j,k) = g%mask2dCv(i,j) * (v_init(i,j,k) + dt_pred * &
513 (v_bc_accel(i,j,k) + cs%v_accel_bt(i,j,k)))
515 do j=js,je ;
do i=isq,ieq
516 up(i,j,k) = g%mask2dCu(i,j) * (u_init(i,j,k) + dt_pred * &
517 (u_bc_accel(i,j,k) + cs%u_accel_bt(i,j,k)))
523 call uvchksum(
"Predictor 1 [uv]", up, vp, g%HI, haloshift=0, symmetric=sym)
524 call hchksum(h,
"Predictor 1 h", g%HI, haloshift=1, scale=gv%H_to_m)
525 call uvchksum(
"Predictor 1 [uv]h", uh, vh, g%HI,haloshift=2, &
526 symmetric=sym, scale=gv%H_to_m)
529 cs%diffu, cs%diffv, g, gv, cs%pbce, cs%u_accel_bt, cs%v_accel_bt, symmetric=sym)
530 call mom_state_chksum(
"Predictor 1 init", u_init, v_init, h, uh, vh, g, gv, haloshift=2, &
540 call uvchksum(
"0 before vertvisc: [uv]p", up, vp, g%HI,haloshift=0, symmetric=sym)
542 call vertvisc_coef(up, vp, h, fluxes, visc, dt_pred, g, gv, cs%vertvisc_CSp, &
544 call vertvisc(up, vp, h, fluxes, visc, dt_pred, cs%OBC, cs%ADp, cs%CDp, g, &
545 gv, cs%vertvisc_CSp, cs%taux_bot, cs%tauy_bot)
546 if (showcalltree)
call calltree_waypoint(
"done with vertvisc (step_MOM_dyn_split_RK2)")
547 if (g%nonblocking_updates)
then 552 call vertvisc_remnant(visc, cs%visc_rem_u, cs%visc_rem_v, dt_pred, g, gv, cs%vertvisc_CSp)
556 call do_group_pass(cs%pass_visc_rem, g%Domain)
557 if (g%nonblocking_updates)
then 560 call do_group_pass(cs%pass_uvp, g%Domain)
567 call continuity(up, vp, h, hp, uh, vh, dt, g, gv, cs%continuity_CSp, &
568 cs%uhbt, cs%vhbt, cs%OBC, cs%visc_rem_u, cs%visc_rem_v, &
569 u_av, v_av, bt_cont=cs%BT_cont)
571 if (showcalltree)
call calltree_waypoint(
"done with continuity (step_MOM_dyn_split_RK2)")
574 if (
associated(cs%OBC))
then 577 call do_group_pass(cs%pass_hp_uv, g%Domain)
580 call radiation_open_bdry_conds(cs%OBC, u_av, u_old_rad_obc, v_av, v_old_rad_obc, g, dt_pred)
584 call do_group_pass(cs%pass_hp_uv, g%Domain)
585 if (g%nonblocking_updates)
then 592 do k=1,nz ;
do j=js-2,je+2 ;
do i=is-2,ie+2
593 h_av(i,j,k) = 0.5*(h(i,j,k) + hp(i,j,k))
594 enddo ;
enddo ;
enddo 597 call enable_averaging(dt, time_local, cs%diag)
604 call bt_mass_source(hp, eta_pred, fluxes, .false., dt_therm, &
605 dt_since_flux+dt, g, gv, cs%barotropic_CSp)
608 if (cs%begw /= 0.0)
then 613 do k=1,nz ;
do j=js-1,je+1 ;
do i=is-1,ie+1
614 hp(i,j,k) = (1.0-cs%begw)*h(i,j,k) + cs%begw*hp(i,j,k)
615 enddo ;
enddo ;
enddo 621 cs%PressureForce_CSp, cs%ALE_CSp, &
622 p_surf, cs%pbce, cs%eta_PF)
624 if (showcalltree)
call calltree_waypoint(
"done with PressureForce[hp=(1-b).h+b.h] (step_MOM_dyn_split_RK2)")
627 if (g%nonblocking_updates)
then 633 if (bt_cont_bt_thick)
then 634 call btcalc(h, g, gv, cs%barotropic_CSp, cs%BT_cont%h_u, cs%BT_cont%h_v, &
636 if (showcalltree)
call calltree_waypoint(
"done with btcalc[BT_cont_BT_thick] (step_MOM_dyn_split_RK2)")
640 call mom_state_chksum(
"Predictor ", up, vp, hp, uh, vh, g, gv, symmetric=sym)
641 call uvchksum(
"Predictor avg [uv]", u_av, v_av, g%HI, haloshift=1, symmetric=sym)
642 call hchksum(h_av,
"Predictor avg h", g%HI, haloshift=0, scale=gv%H_to_m)
651 meke, varmix, g, gv, cs%hor_visc_CSp, obc=cs%OBC)
653 if (showcalltree)
call calltree_waypoint(
"done with horizontal_viscosity (step_MOM_dyn_split_RK2)")
657 call coradcalc(u_av, v_av, h_av, uh, vh, cs%CAu, cs%CAv, cs%OBC, cs%ADp, &
658 g, gv, cs%CoriolisAdv_CSp)
660 if (showcalltree)
call calltree_waypoint(
"done with CorAdCalc (step_MOM_dyn_split_RK2)")
668 do j=js,je ;
do i=isq,ieq
669 u_bc_accel(i,j,k) = (cs%Cau(i,j,k) + cs%PFu(i,j,k)) + cs%diffu(i,j,k)
671 do j=jsq,jeq ;
do i=is,ie
672 v_bc_accel(i,j,k) = (cs%Cav(i,j,k) + cs%PFv(i,j,k)) + cs%diffv(i,j,k)
675 if (
associated(cs%OBC))
then 681 call mom_accel_chksum(
"corr pre-btstep accel", cs%CAu, cs%CAv, cs%PFu, cs%PFv, &
682 cs%diffu, cs%diffv, g, gv, cs%pbce, u_bc_accel, v_bc_accel, &
686 call check_redundant(
"corr pre-btstep CS%diff ", cs%diffu, cs%diffv, g)
687 call check_redundant(
"corr pre-btstep u_bc_accel ", u_bc_accel, v_bc_accel, g)
693 if (cs%BT_use_layer_fluxes)
then 694 uh_ptr => uh ; vh_ptr => vh ; u_ptr => u_av ; v_ptr => v_av
697 if (showcalltree)
call calltree_enter(
"btstep(), MOM_barotropic.F90")
699 call btstep(u, v, eta, dt, u_bc_accel, v_bc_accel, &
700 fluxes, cs%pbce, cs%eta_PF, u_av, v_av, cs%u_accel_bt, &
701 cs%v_accel_bt, eta_pred, cs%uhbt, cs%vhbt, g, gv, &
702 cs%barotropic_CSp, cs%visc_rem_u, cs%visc_rem_v, &
703 etaav=eta_av, obc=cs%OBC, &
704 bt_cont = cs%BT_cont, eta_pf_start=eta_pf_start, &
705 taux_bot=taux_bot, tauy_bot=tauy_bot, &
706 uh0=uh_ptr, vh0=vh_ptr, u_uh0=u_ptr, v_vh0=v_ptr)
707 do j=js,je ;
do i=is,ie ; eta(i,j) = eta_pred(i,j) ;
enddo ;
enddo 719 do j=js,je ;
do i=isq,ieq
720 u(i,j,k) = g%mask2dCu(i,j) * (u_init(i,j,k) + dt * &
721 (u_bc_accel(i,j,k) + cs%u_accel_bt(i,j,k)))
723 do j=jsq,jeq ;
do i=is,ie
724 v(i,j,k) = g%mask2dCv(i,j) * (v_init(i,j,k) + dt * &
725 (v_bc_accel(i,j,k) + cs%v_accel_bt(i,j,k)))
731 call uvchksum(
"Corrector 1 [uv]", u, v, g%HI,haloshift=0, symmetric=sym)
732 call hchksum(h,
"Corrector 1 h", g%HI, haloshift=2, scale=gv%H_to_m)
733 call uvchksum(
"Corrector 1 [uv]h", uh, vh, g%HI, haloshift=2, &
734 symmetric=sym, scale=gv%H_to_m)
737 cs%diffu, cs%diffv, g, gv, cs%pbce, cs%u_accel_bt, cs%v_accel_bt, &
744 call vertvisc_coef(u, v, h, fluxes, visc, dt, g, gv, cs%vertvisc_CSp, cs%OBC)
745 call vertvisc(u, v, h, fluxes, visc, dt, cs%OBC, cs%ADp, cs%CDp, g, gv, &
746 cs%vertvisc_CSp, cs%taux_bot, cs%tauy_bot)
747 if (g%nonblocking_updates)
then 752 call vertvisc_remnant(visc, cs%visc_rem_u, cs%visc_rem_v, dt, g, gv, cs%vertvisc_CSp)
754 if (showcalltree)
call calltree_waypoint(
"done with vertvisc (step_MOM_dyn_split_RK2)")
758 do k=1,nz ;
do j=js-2,je+2 ;
do i=is-2,ie+2
759 h_av(i,j,k) = h(i,j,k)
760 enddo ;
enddo ;
enddo 763 call do_group_pass(cs%pass_visc_rem, g%Domain)
764 if (g%nonblocking_updates)
then 767 call do_group_pass(cs%pass_uv, g%Domain)
775 call continuity(u, v, h, h, uh, vh, dt, g, gv, &
776 cs%continuity_CSp, cs%uhbt, cs%vhbt, cs%OBC, &
777 cs%visc_rem_u, cs%visc_rem_v, u_av, v_av)
780 call do_group_pass(cs%pass_h, g%Domain)
785 if (showcalltree)
call calltree_waypoint(
"done with continuity (step_MOM_dyn_split_RK2)")
788 if (g%nonblocking_updates)
then 791 call do_group_pass(cs%pass_av_uvh, g%domain)
795 if (
associated(cs%OBC))
then 796 call radiation_open_bdry_conds(cs%OBC, u, u_old_rad_obc, v, v_old_rad_obc, g, dt)
801 do k=1,nz ;
do j=js-2,je+2 ;
do i=is-2,ie+2
802 h_av(i,j,k) = 0.5*(h_av(i,j,k) + h(i,j,k))
803 enddo ;
enddo ;
enddo 805 if (g%nonblocking_updates)
then 812 do j=js-2,je+2 ;
do i=isq-2,ieq+2
813 uhtr(i,j,k) = uhtr(i,j,k) + uh(i,j,k)*dt
815 do j=jsq-2,jeq+2 ;
do i=is-2,ie+2
816 vhtr(i,j,k) = vhtr(i,j,k) + vh(i,j,k)*dt
825 if (cs%id_PFu > 0)
call post_data(cs%id_PFu, cs%PFu, cs%diag)
826 if (cs%id_PFv > 0)
call post_data(cs%id_PFv, cs%PFv, cs%diag)
827 if (cs%id_CAu > 0)
call post_data(cs%id_CAu, cs%CAu, cs%diag)
828 if (cs%id_CAv > 0)
call post_data(cs%id_CAv, cs%CAv, cs%diag)
831 if (cs%id_uh > 0)
call post_data(cs%id_uh , uh, cs%diag)
832 if (cs%id_vh > 0)
call post_data(cs%id_vh , vh, cs%diag)
833 if (cs%id_uav > 0)
call post_data(cs%id_uav, u_av, cs%diag)
834 if (cs%id_vav > 0)
call post_data(cs%id_vav, v_av, cs%diag)
835 if (cs%id_u_BT_accel > 0)
call post_data(cs%id_u_BT_accel, cs%u_accel_bt, cs%diag)
836 if (cs%id_v_BT_accel > 0)
call post_data(cs%id_v_BT_accel, cs%v_accel_bt, cs%diag)
840 call uvchksum(
"Corrector avg [uv]", u_av, v_av, g%HI,haloshift=1, symmetric=sym)
841 call hchksum(h_av,
"Corrector avg h", g%HI, haloshift=1, scale=gv%H_to_m)
853 type(hor_index_type),
intent(in) :: HI
854 type(verticalgrid_type),
intent(in) :: GV
855 type(param_file_type),
intent(in) :: param_file
857 type(mom_restart_cs),
pointer :: restart_CS
858 real,
dimension(SZIB_(HI),SZJ_(HI),SZK_(GV)),
target,
intent(inout) :: uh
859 real,
dimension(SZI_(HI),SZJB_(HI),SZK_(GV)),
target,
intent(inout) :: vh
862 character(len=40) :: mdl =
"MOM_dynamics_split_RK2" 863 character(len=48) :: thickness_units, flux_units
865 integer :: isd, ied, jsd, jed, nz, IsdB, IedB, JsdB, JedB
866 isd = hi%isd ; ied = hi%ied ; jsd = hi%jsd ; jed = hi%jed ; nz = gv%ke
867 isdb = hi%IsdB ; iedb = hi%IedB ; jsdb = hi%JsdB ; jedb = hi%JedB
870 if (
associated(cs))
then 871 call mom_error(warning,
"register_restarts_dyn_split_RK2 called with an associated "// &
872 "control structure.")
877 alloc_(cs%diffu(isdb:iedb,jsd:jed,nz)) ; cs%diffu(:,:,:) = 0.0
878 alloc_(cs%diffv(isd:ied,jsdb:jedb,nz)) ; cs%diffv(:,:,:) = 0.0
879 alloc_(cs%CAu(isdb:iedb,jsd:jed,nz)) ; cs%CAu(:,:,:) = 0.0
880 alloc_(cs%CAv(isd:ied,jsdb:jedb,nz)) ; cs%CAv(:,:,:) = 0.0
881 alloc_(cs%PFu(isdb:iedb,jsd:jed,nz)) ; cs%PFu(:,:,:) = 0.0
882 alloc_(cs%PFv(isd:ied,jsdb:jedb,nz)) ; cs%PFv(:,:,:) = 0.0
884 alloc_(cs%eta(isd:ied,jsd:jed)) ; cs%eta(:,:) = 0.0
885 alloc_(cs%u_av(isdb:iedb,jsd:jed,nz)) ; cs%u_av(:,:,:) = 0.0
886 alloc_(cs%v_av(isd:ied,jsdb:jedb,nz)) ; cs%v_av(:,:,:) = 0.0
887 alloc_(cs%h_av(isd:ied,jsd:jed,nz)) ; cs%h_av(:,:,:) = gv%Angstrom
889 thickness_units = get_thickness_units(gv)
890 flux_units = get_flux_units(gv)
892 vd = var_desc(
"sfc",thickness_units,
"Free surface Height",
'h',
'1')
893 call register_restart_field(cs%eta, vd, .false., restart_cs)
895 vd = var_desc(
"u2",
"meter second-1",
"Auxiliary Zonal velocity",
'u',
'L')
896 call register_restart_field(cs%u_av, vd, .false., restart_cs)
898 vd = var_desc(
"v2",
"meter second-1",
"Auxiliary Meridional velocity",
'v',
'L')
899 call register_restart_field(cs%v_av, vd, .false., restart_cs)
901 vd = var_desc(
"h2",thickness_units,
"Auxiliary Layer Thickness",
'h',
'L')
902 call register_restart_field(cs%h_av, vd, .false., restart_cs)
904 vd = var_desc(
"uh",flux_units,
"Zonal thickness flux",
'u',
'L')
905 call register_restart_field(uh, vd, .false., restart_cs)
907 vd = var_desc(
"vh",flux_units,
"Meridional thickness flux",
'v',
'L')
908 call register_restart_field(vh, vd, .false., restart_cs)
910 vd = var_desc(
"diffu",
"meter second-2",
"Zonal horizontal viscous acceleration",
'u',
'L')
911 call register_restart_field(cs%diffu, vd, .false., restart_cs)
913 vd = var_desc(
"diffv",
"meter second-2",
"Meridional horizontal viscous acceleration",
'v',
'L')
914 call register_restart_field(cs%diffv, vd, .false., restart_cs)
916 call register_barotropic_restarts(hi, gv, param_file, cs%barotropic_CSp, &
923 subroutine initialize_dyn_split_rk2(u, v, h, uh, vh, eta, Time, G, GV, param_file, &
924 diag, CS, restart_CS, dt, Accel_diag, Cont_diag, MIS, &
925 VarMix, MEKE, OBC, update_OBC_CSp, ALE_CSp, setVisc_CSp, &
927 type(ocean_grid_type),
intent(inout) :: G
928 type(verticalgrid_type),
intent(in) :: GV
929 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(inout) :: u
930 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(inout) :: v
931 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) ,
intent(inout) :: h
932 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
target,
intent(inout) :: uh
933 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
target,
intent(inout) :: vh
934 real,
dimension(SZI_(G),SZJ_(G)),
intent(inout) :: eta
935 type(time_type),
target,
intent(in) :: Time
936 type(param_file_type),
intent(in) :: param_file
937 type(diag_ctrl),
target,
intent(inout) :: diag
939 type(mom_restart_cs),
pointer :: restart_CS
940 real,
intent(in) :: dt
941 type(accel_diag_ptrs),
target,
intent(inout) :: Accel_diag
942 type(cont_diag_ptrs),
target,
intent(inout) :: Cont_diag
943 type(ocean_internal_state),
intent(inout) :: MIS
944 type(varmix_cs),
pointer :: VarMix
945 type(meke_type),
pointer :: MEKE
946 type(ocean_obc_type),
pointer :: OBC
947 type(update_obc_cs),
pointer :: update_OBC_CSp
948 type(ale_cs),
pointer :: ALE_CSp
949 type(set_visc_cs),
pointer :: setVisc_CSp
950 type(vertvisc_type),
intent(inout) :: visc
951 type(directories),
intent(in) :: dirs
952 integer,
target,
intent(inout) :: ntrunc
955 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) :: h_tmp
956 character(len=40) :: mdl =
"MOM_dynamics_split_RK2" 957 character(len=48) :: thickness_units, flux_units
958 type(group_pass_type) :: pass_h_tmp, pass_av_h_uvh
959 logical :: use_tides, debug_truncations
961 integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz
962 integer :: IsdB, IedB, JsdB, JedB
963 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
964 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
965 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
967 if (.not.
associated(cs))
call mom_error(fatal, &
968 "initialize_dyn_split_RK2 called with an unassociated control structure.")
969 if (cs%module_is_initialized)
then 970 call mom_error(warning,
"initialize_dyn_split_RK2 called with a control "// &
971 "structure that has already been initialized.")
974 cs%module_is_initialized = .true.
978 call get_param(param_file, mdl,
"TIDES", use_tides, &
979 "If true, apply tidal momentum forcing.", default=.false.)
980 call get_param(param_file, mdl,
"BE", cs%be, &
981 "If SPLIT is true, BE determines the relative weighting \n"//&
982 "of a 2nd-order Runga-Kutta baroclinic time stepping \n"//&
983 "scheme (0.5) and a backward Euler scheme (1) that is \n"//&
984 "used for the Coriolis and inertial terms. BE may be \n"//&
985 "from 0.5 to 1, but instability may occur near 0.5. \n"//&
986 "BE is also applicable if SPLIT is false and USE_RK2 \n"//&
987 "is true.", units=
"nondim", default=0.6)
988 call get_param(param_file, mdl,
"BEGW", cs%begw, &
989 "If SPLIT is true, BEGW is a number from 0 to 1 that \n"//&
990 "controls the extent to which the treatment of gravity \n"//&
991 "waves is forward-backward (0) or simulated backward \n"//&
992 "Euler (1). 0 is almost always used.\n"//&
993 "If SPLIT is false and USE_RK2 is true, BEGW can be \n"//&
994 "between 0 and 0.5 to damp gravity waves.", &
995 units=
"nondim", default=0.0)
997 call get_param(param_file, mdl,
"SPLIT_BOTTOM_STRESS", cs%split_bottom_stress, &
998 "If true, provide the bottom stress calculated by the \n"//&
999 "vertical viscosity to the barotropic solver.", default=.false.)
1000 call get_param(param_file, mdl,
"BT_USE_LAYER_FLUXES", cs%BT_use_layer_fluxes, &
1001 "If true, use the summed layered fluxes plus an \n"//&
1002 "adjustment due to the change in the barotropic velocity \n"//&
1003 "in the barotropic continuity equation.", default=.true.)
1004 call get_param(param_file, mdl,
"DEBUG", cs%debug, &
1005 "If true, write out verbose debugging data.", default=.false.)
1006 call get_param(param_file, mdl,
"DEBUG_TRUNCATIONS", debug_truncations, &
1009 allocate(cs%taux_bot(isdb:iedb,jsd:jed)) ; cs%taux_bot(:,:) = 0.0
1010 allocate(cs%tauy_bot(isd:ied,jsdb:jedb)) ; cs%tauy_bot(:,:) = 0.0
1012 alloc_(cs%uhbt(isdb:iedb,jsd:jed)) ; cs%uhbt(:,:) = 0.0
1013 alloc_(cs%vhbt(isd:ied,jsdb:jedb)) ; cs%vhbt(:,:) = 0.0
1014 alloc_(cs%visc_rem_u(isdb:iedb,jsd:jed,nz)) ; cs%visc_rem_u(:,:,:) = 0.0
1015 alloc_(cs%visc_rem_v(isd:ied,jsdb:jedb,nz)) ; cs%visc_rem_v(:,:,:) = 0.0
1016 alloc_(cs%eta_PF(isd:ied,jsd:jed)) ; cs%eta_PF(:,:) = 0.0
1017 alloc_(cs%pbce(isd:ied,jsd:jed,nz)) ; cs%pbce(:,:,:) = 0.0
1019 alloc_(cs%u_accel_bt(isdb:iedb,jsd:jed,nz)) ; cs%u_accel_bt(:,:,:) = 0.0
1020 alloc_(cs%v_accel_bt(isd:ied,jsdb:jedb,nz)) ; cs%v_accel_bt(:,:,:) = 0.0
1022 mis%diffu => cs%diffu
1023 mis%diffv => cs%diffv
1029 mis%u_accel_bt => cs%u_accel_bt
1030 mis%v_accel_bt => cs%v_accel_bt
1034 cs%ADp => accel_diag
1036 accel_diag%diffu => cs%diffu
1037 accel_diag%diffv => cs%diffv
1038 accel_diag%PFu => cs%PFu
1039 accel_diag%PFv => cs%PFv
1040 accel_diag%CAu => cs%CAu
1041 accel_diag%CAv => cs%CAv
1047 call continuity_init(time, g, gv, param_file, diag, cs%continuity_CSp)
1048 call coriolisadv_init(time, g, param_file, diag, cs%ADp, cs%CoriolisAdv_CSp)
1049 if (use_tides)
call tidal_forcing_init(time, g, param_file, cs%tides_CSp)
1050 call pressureforce_init(time, g, gv, param_file, diag, cs%PressureForce_CSp, &
1052 call hor_visc_init(time, g, param_file, diag, cs%hor_visc_CSp)
1053 call vertvisc_init(mis, time, g, gv, param_file, diag, cs%ADp, dirs, &
1054 ntrunc, cs%vertvisc_CSp)
1055 if (.not.
associated(setvisc_csp))
call mom_error(fatal, &
1056 "initialize_dyn_split_RK2 called with setVisc_CSp unassociated.")
1057 cs%set_visc_CSp => setvisc_csp
1058 call updatecfltruncationvalue(time, cs%vertvisc_CSp, activate= &
1059 ((dirs%input_filename(1:1) ==
'n') .and. &
1060 (len_trim(dirs%input_filename) == 1)) )
1062 if (
associated(ale_csp)) cs%ALE_CSp => ale_csp
1063 if (
associated(obc)) cs%OBC => obc
1064 if (
associated(update_obc_csp)) cs%update_OBC_CSp => update_obc_csp
1066 if (.not. query_initialized(cs%eta,
"sfc",restart_cs))
then 1072 if (gv%Boussinesq)
then 1073 do j=js,je ;
do i=is,ie ; cs%eta(i,j) = -g%bathyT(i,j) * gv%m_to_H ;
enddo ;
enddo 1075 do k=1,nz ;
do j=js,je ;
do i=is,ie
1076 cs%eta(i,j) = cs%eta(i,j) + h(i,j,k)
1077 enddo ;
enddo ;
enddo 1080 do j=js,je ;
do i=is,ie ; eta(i,j) = cs%eta(i,j) ;
enddo ;
enddo 1082 call barotropic_init(u, v, h, cs%eta, time, g, gv, param_file, diag, &
1083 cs%barotropic_CSp, restart_cs, cs%BT_cont, cs%tides_CSp)
1085 if (.not. query_initialized(cs%diffu,
"diffu",restart_cs) .or. &
1086 .not. query_initialized(cs%diffv,
"diffv",restart_cs)) &
1087 call horizontal_viscosity(u, v, h, cs%diffu, cs%diffv, meke, varmix, &
1088 g, gv, cs%hor_visc_CSp, obc=cs%OBC)
1089 if (.not. query_initialized(cs%u_av,
"u2", restart_cs) .or. &
1090 .not. query_initialized(cs%u_av,
"v2", restart_cs))
then 1091 cs%u_av(:,:,:) = u(:,:,:)
1092 cs%v_av(:,:,:) = v(:,:,:)
1096 if (.not. query_initialized(uh,
"uh",restart_cs) .or. &
1097 .not. query_initialized(vh,
"vh",restart_cs))
then 1098 h_tmp(:,:,:) = h(:,:,:)
1099 call continuity(u, v, h, h_tmp, uh, vh, dt, g, gv, cs%continuity_CSp, obc=cs%OBC)
1101 call create_group_pass(pass_h_tmp, h_tmp, g%Domain)
1102 call do_group_pass(pass_h_tmp, g%Domain)
1104 cs%h_av(:,:,:) = 0.5*(h(:,:,:) + h_tmp(:,:,:))
1106 if (.not. query_initialized(cs%h_av,
"h2",restart_cs)) &
1107 cs%h_av(:,:,:) = h(:,:,:)
1111 call create_group_pass(pass_av_h_uvh, cs%u_av, cs%v_av, g%Domain, halo=2)
1112 call create_group_pass(pass_av_h_uvh, cs%h_av, g%Domain, halo=2)
1113 call create_group_pass(pass_av_h_uvh, uh, vh, g%Domain, halo=2)
1114 call do_group_pass(pass_av_h_uvh, g%Domain)
1117 flux_units = get_flux_units(gv)
1118 cs%id_uh = register_diag_field(
'ocean_model',
'uh', diag%axesCuL, time, &
1119 'Zonal Thickness Flux', flux_units, y_cell_method=
'sum', v_extensive=.true.)
1120 cs%id_vh = register_diag_field(
'ocean_model',
'vh', diag%axesCvL, time, &
1121 'Meridional Thickness Flux', flux_units, x_cell_method=
'sum', v_extensive=.true.)
1123 cs%id_CAu = register_diag_field(
'ocean_model',
'CAu', diag%axesCuL, time, &
1124 'Zonal Coriolis and Advective Acceleration',
'meter second-2')
1125 cs%id_CAv = register_diag_field(
'ocean_model',
'CAv', diag%axesCvL, time, &
1126 'Meridional Coriolis and Advective Acceleration',
'meter second-2')
1127 cs%id_PFu = register_diag_field(
'ocean_model',
'PFu', diag%axesCuL, time, &
1128 'Zonal Pressure Force Acceleration',
'meter second-2')
1129 cs%id_PFv = register_diag_field(
'ocean_model',
'PFv', diag%axesCvL, time, &
1130 'Meridional Pressure Force Acceleration',
'meter second-2')
1132 cs%id_uav = register_diag_field(
'ocean_model',
'uav', diag%axesCuL, time, &
1133 'Barotropic-step Averaged Zonal Velocity',
'meter second-1')
1134 cs%id_vav = register_diag_field(
'ocean_model',
'vav', diag%axesCvL, time, &
1135 'Barotropic-step Averaged Meridional Velocity',
'meter second-1')
1137 cs%id_u_BT_accel = register_diag_field(
'ocean_model',
'u_BT_accel', diag%axesCuL, time, &
1138 'Barotropic Anomaly Zonal Acceleration',
'meter second-1')
1139 cs%id_v_BT_accel = register_diag_field(
'ocean_model',
'v_BT_accel', diag%axesCvL, time, &
1140 'Barotropic Anomaly Meridional Acceleration',
'meter second-1')
1142 id_clock_cor = cpu_clock_id(
'(Ocean Coriolis & mom advection)', grain=clock_module)
1144 id_clock_pres = cpu_clock_id(
'(Ocean pressure force)', grain=clock_module)
1145 id_clock_vertvisc = cpu_clock_id(
'(Ocean vertical viscosity)', grain=clock_module)
1146 id_clock_horvisc = cpu_clock_id(
'(Ocean horizontal viscosity)', grain=clock_module)
1148 id_clock_pass = cpu_clock_id(
'(Ocean message passing)', grain=clock_module)
1149 id_clock_pass_init = cpu_clock_id(
'(Ocean init message passing)', grain=clock_routine)
1150 id_clock_btcalc = cpu_clock_id(
'(Ocean barotropic mode calc)', grain=clock_module)
1151 id_clock_btstep = cpu_clock_id(
'(Ocean barotropic mode stepping)', grain=clock_module)
1152 id_clock_btforce = cpu_clock_id(
'(Ocean barotropic forcing calc)', grain=clock_module)
1161 dealloc_(cs%diffu) ; dealloc_(cs%diffv)
1162 dealloc_(cs%CAu) ; dealloc_(cs%CAv)
1163 dealloc_(cs%PFu) ; dealloc_(cs%PFv)
1165 if (
associated(cs%taux_bot))
deallocate(cs%taux_bot)
1166 if (
associated(cs%tauy_bot))
deallocate(cs%tauy_bot)
1167 dealloc_(cs%uhbt) ; dealloc_(cs%vhbt)
1168 dealloc_(cs%u_accel_bt) ; dealloc_(cs%v_accel_bt)
1169 dealloc_(cs%visc_rem_u) ; dealloc_(cs%visc_rem_v)
1171 dealloc_(cs%eta) ; dealloc_(cs%eta_PF) ; dealloc_(cs%pbce)
1172 dealloc_(cs%h_av) ; dealloc_(cs%u_av) ; dealloc_(cs%v_av)
1174 call dealloc_bt_cont_type(cs%BT_cont)
subroutine, public register_barotropic_restarts(HI, GV, param_file, CS, restart_CS)
This subroutine is used to register any fields from MOM_barotropic.F90 that should be written to or r...
subroutine, public mom_io_init(param_file)
Initialize the MOM_io module.
subroutine, public barotropic_init(u, v, h, eta, Time, G, GV, param_file, diag, CS, restart_CS, BT_cont, tides_CSp)
barotropic_init initializes a number of time-invariant fields used in the barotropic calculation and ...
Module control structure.
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. ...
type(vardesc) function, public var_desc(name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, conversion, caller)
Returns a vardesc type whose elements have been filled with the provided fields. The argument name is...
subroutine, public initialize_dyn_split_rk2(u, v, h, uh, vh, eta, Time, G, GV, param_file, diag, CS, restart_CS, dt, Accel_diag, Cont_diag, MIS, VarMix, MEKE, OBC, update_OBC_CSp, ALE_CSp, setVisc_CSp, visc, dirs, ntrunc)
This subroutine initializes all of the variables that are used by this dynamic core, including diagnostics and the cpu clocks.
This module contains the main regridding routines. Regridding comprises two steps: (1) Interpolation ...
subroutine, public alloc_bt_cont_type(BT_cont, G, alloc_faces)
alloc_BT_cont_type allocates the arrays contained within a BT_cont_type and initializes them to 0...
subroutine, public step_mom_dyn_split_rk2(u, v, h, tv, visc, Time_local, dt, fluxes, p_surf_begin, p_surf_end, dt_since_flux, dt_therm, uh, vh, uhtr, vhtr, eta_av, G, GV, CS, calc_dtbt, VarMix, MEKE)
RK2 splitting for time stepping MOM adiabatic dynamics.
character(len=48) function, public get_flux_units(GV)
Returns the model's thickness flux units, usually m^3/s or kg/s.
This module implements boundary forcing for MOM6.
integer id_clock_thick_diff
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.
subroutine, public diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, G, GV, CS)
This subroutine imposes the diapycnal mass fluxes and the accompanying diapycnal advection of momentu...
Solve the layer continuity equation.
Controls where open boundary conditions are applied.
subroutine, public vertvisc_remnant(visc, visc_rem_u, visc_rem_v, dt, G, GV, CS)
Calculate the fraction of momentum originally in a layer that remains after a time-step of viscosity...
Implements vertical viscosity (vertvisc)
Provides the ocean grid type.
subroutine, public do_group_pass(group, MOM_dom)
subroutine, public updatecfltruncationvalue(Time, CS, activate)
Update the CFL truncation value as a function of time. If called with the optional argument activate=...
The vertvisc_type structure contains vertical viscosities, drag coefficients, and related fields...
subroutine, public register_restarts_dyn_split_rk2(HI, GV, param_file, CS, restart_CS, uh, vh)
This subroutine sets up any auxiliary restart variables that are specific to the unsplit time steppin...
subroutine, public pressureforce_init(Time, G, GV, param_file, diag, CS, tides_CSp)
Initialize the pressure force control structure.
This routine drives the diabatic/dianeutral physics for MOM.
Accelerations due to the Coriolis force and momentum advection.
integer id_clock_vertvisc
subroutine, public calltree_leave(mesg)
Writes a message about leaving a subroutine if call tree reporting is active.
A thin wrapper for Boussinesq/non-Boussinesq forms of the pressure force calculation.
subroutine, public end_dyn_split_rk2(CS)
Close the dyn_split_RK2 module.
integer id_clock_mom_update
This module contains I/O framework code.
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's tracer flux units.
Container for horizontal index ranges for data, computational and global domains. ...
Control structure for mom_coriolisadv.
subroutine, public set_dtbt(G, GV, CS, eta, pbce, BT_cont, gtot_est, SSH_add)
This subroutine automatically determines an optimal value for dtbt based on some state of the ocean...
Variable mixing coefficients.
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...
subroutine, public start_group_pass(group, MOM_dom)
The BT_cont_type structure contains information about the summed layer transports and how they will v...
subroutine, public dealloc_bt_cont_type(BT_cont)
dealloc_BT_cont_type deallocates the arrays contained within a BT_cont_type.
subroutine, public calltree_waypoint(mesg, n)
Writes a message about reaching a milestone if call tree reporting is active.
Control structure for mom_continuity.
integer id_clock_pass_init
subroutine, public open_boundary_zero_normal_flow(OBC, G, u, v)
Applies zero values to 3d u,v fields on OBC segments.
subroutine, public bt_mass_source(h, eta, fluxes, set_cor, dt_therm, dt_since_therm, G, GV, CS)
bt_mass_source determines the appropriately limited mass source for the barotropic solver...
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()
subroutine, public complete_group_pass(group, MOM_dom)
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...
subroutine, public mom_set_verbosity(verb)
character(len=48) function, public get_thickness_units(GV)
Returns the model'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 btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, fluxes, pbce, eta_PF_in, U_Cor, V_Cor, accel_layer_u, accel_layer_v, eta_out, uhbtav, vhbtav, G, GV, CS, visc_rem_u, visc_rem_v, etaav, OBC, BT_cont, eta_PF_start, taux_bot, tauy_bot, uh0, vh0, u_uh0, v_vh0)
This subroutine time steps the barotropic equations explicitly. For gravity waves, anything between a forwards-backwards scheme and a simulated backwards Euler scheme is used, with bebt between 0.0 and 1.0 determining the scheme. In practice, bebt must be of order 0.2 or greater. A forwards-backwards treatment of the Coriolis terms is always used.
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)
logical function, public calltree_showquery()
Returns True, if the verbosity>=6 indicating to show the call tree.
Type for describing a variable, typically a tracer.
Control structure for this module.
integer function, public continuity_stencil(CS)
continuity_stencil returns the continuity solver stencil size
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...
integer id_clock_continuity
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 ...
Controls where open boundary conditions are applied.
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...
subroutine, public mom_error(level, message, all_print)
subroutine, public btcalc(h, G, GV, CS, h_u, h_v, may_use_default, OBC)
btcalc calculates the barotropic velocities from the full velocity and thickness fields, determines the fraction of the total water column in each layer at velocity points, and determines a corrective fictitious mass source that will drive the barotropic estimate of the free surface height toward the baroclinic estimate.
Time step the adiabatic dynamic core of MOM using RK2 method.
subroutine, public diabatic_driver_init(Time, G, GV, param_file, useALEalgorithm, diag, ADp, CDp, CS, tracer_flow_CSp, sponge_CSp, ALE_sponge_CSp, diag_to_Z_CSp)
This routine initializes the diabatic driver module.
subroutine, public calltree_enter(mesg, n)
Writes a message about entering a subroutine if call tree reporting is active.