10 use mom_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
11 use mom_cpu_clock, only : clock_module_driver, clock_module, clock_routine
63 use time_manager_mod
, only : increment_time
66 implicit none ;
private 68 #include <MOM_memory.h> 81 logical :: use_energetic_pbl
84 logical :: use_kappa_shear
86 logical :: use_cvmix_shear
92 logical :: use_geothermal
93 logical :: use_int_tides
95 logical :: epbl_is_additive
99 logical :: int_tide_source_test
101 real :: int_tide_source_x
103 real :: int_tide_source_y
107 logical :: uniform_cg
111 type(time_type) :: time_max_source
112 type(time_type) :: time_end
113 logical :: usealealgorithm
116 logical :: aggregate_fw_forcing
126 logical :: massless_match_targets
128 logical :: mix_boundary_tracers
139 real :: minimum_forcing_depth = 0.001
141 real :: evap_cfl_limit = 0.8
145 logical :: salt_reject_below_ml
146 logical :: kppispassive
147 logical :: useconvection
150 logical :: debugconservation
151 logical :: tracer_tridiag
153 logical :: debug_energy_req
155 real :: mlddensitydifference
158 integer :: id_cg1 = -1
159 integer,
allocatable,
dimension(:) :: id_cn
160 integer :: id_dudt_dia = -1, id_dvdt_dia = -1, id_wd = -1
161 integer :: id_ea = -1, id_eb = -1, id_kd_z = -1
162 integer :: id_kd_heat = -1, id_kd_salt = -1, id_kd_interface = -1, id_kd_epbl = -1
163 integer :: id_tdif_z = -1, id_tadv_z = -1, id_sdif_z = -1, id_sadv_z = -1
164 integer :: id_tdif = -1, id_tadv = -1, id_sdif = -1, id_sadv = -1
165 integer :: id_mld_003 = -1, id_mld_0125 = -1, id_mld_user = -1, id_mlotstsq = -1
166 integer :: id_submln2 = -1, id_brine_lay = -1
168 integer :: id_diabatic_diff_temp_tend = -1
169 integer :: id_diabatic_diff_saln_tend = -1
170 integer :: id_diabatic_diff_heat_tend = -1
171 integer :: id_diabatic_diff_salt_tend = -1
172 integer :: id_diabatic_diff_heat_tend_2d = -1
173 integer :: id_diabatic_diff_salt_tend_2d = -1
174 logical :: diabatic_diff_tendency_diag = .false.
176 integer :: id_boundary_forcing_temp_tend = -1
177 integer :: id_boundary_forcing_saln_tend = -1
178 integer :: id_boundary_forcing_heat_tend = -1
179 integer :: id_boundary_forcing_salt_tend = -1
180 integer :: id_boundary_forcing_heat_tend_2d = -1
181 integer :: id_boundary_forcing_salt_tend_2d = -1
182 logical :: boundary_forcing_tendency_diag = .false.
184 integer :: id_frazil_temp_tend = -1
185 integer :: id_frazil_heat_tend = -1
186 integer :: id_frazil_heat_tend_2d = -1
187 logical :: frazil_tendency_diag = .false.
188 real,
allocatable,
dimension(:,:,:) :: frazil_heat_diag
189 real,
allocatable,
dimension(:,:,:) :: frazil_temp_diag
191 real :: ppt2mks = 0.001
209 type(
kpp_cs),
pointer :: kpp_csp => null()
213 type(group_pass_type) :: pass_hold_eb_ea
216 real,
allocatable,
dimension(:,:,:) :: kpp_nltheat
217 real,
allocatable,
dimension(:,:,:) :: kpp_nltscalar
218 real,
allocatable,
dimension(:,:,:) :: kpp_buoy_flux
219 real,
allocatable,
dimension(:,:) :: kpp_temp_flux
220 real,
allocatable,
dimension(:,:) :: kpp_salt_flux
234 subroutine diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, G, GV, CS)
237 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(inout) :: u
238 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(inout) :: v
239 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(inout) :: h
241 real,
dimension(:,:),
pointer :: Hml
242 type(
forcing),
intent(inout) :: fluxes
247 real,
intent(in) :: dt
250 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) :: &
267 real,
dimension(SZI_(G),SZJ_(G),CS%nMode) :: &
270 real,
dimension(SZI_(G),SZJ_(G)) :: &
273 real,
dimension(SZI_(G),SZJ_(G),G%ke) :: h_diag
274 real,
dimension(SZI_(G),SZJ_(G),G%ke) :: temp_diag
275 real,
dimension(SZI_(G),SZJ_(G),G%ke) :: saln_diag
276 real,
dimension(SZI_(G),SZJ_(G)) :: tendency_2d
277 real,
dimension(SZI_(G),SZJ_(G)) :: TKE_itidal_input_test
281 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
target :: &
287 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)+1),
target :: &
298 real,
pointer,
dimension(:,:,:) :: &
304 integer :: kb(szi_(g),szj_(g))
307 real :: p_ref_cv(szi_(g))
311 logical :: in_boundary(szi_(g))
331 real :: htot(szib_(g))
332 real :: b1(szib_(g)), d1(szib_(g))
333 real :: c1(szib_(g),szk_(g))
340 type(
p3d) :: z_ptrs(7)
341 integer :: num_z_diags
343 logical :: showCallTree
344 integer :: i, j, k, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz, nkmb, m
347 logical :: avg_enabled
350 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
351 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
352 nkmb = gv%nk_rho_varies
353 h_neglect = gv%H_subroundoff ; h_neglect2 = h_neglect*h_neglect
354 kd_heat(:,:,:) = 0.0 ; kd_salt(:,:,:) = 0.0
358 showcalltree = calltree_showquery()
359 if (showcalltree)
call calltree_enter(
"diabatic(), MOM_diabatic_driver.F90")
362 eaml => eatr ; ebml => ebtr
367 if (.not.
associated(cs))
call mom_error(fatal,
"MOM_diabatic_driver: "// &
368 "Module must be initialized before it is used.")
372 call mom_forcing_chksum(
"Start of diabatic", fluxes, g, haloshift=0)
374 if (cs%debugConservation)
call mom_state_stats(
'Start of diabatic', u, v, h, tv%T, tv%S, g)
376 if (cs%debug_energy_req) &
381 call set_bbl_tke(u, v, h, fluxes, visc, g, gv, cs%set_diff_CSp)
387 if (
ASSOCIATED(tv%T) .AND.
ASSOCIATED(tv%frazil))
then 389 if(cs%frazil_tendency_diag)
then 390 do k=1,nz ;
do j=js,je ;
do i=is,ie
391 temp_diag(i,j,k) = tv%T(i,j,k)
392 enddo ;
enddo ;
enddo 395 if (
ASSOCIATED(fluxes%p_surf_full))
then 396 call make_frazil(h, tv, g, gv, cs%diabatic_aux_CSp, fluxes%p_surf_full)
398 call make_frazil(h, tv, g, gv, cs%diabatic_aux_CSp)
402 if (cs%frazil_tendency_diag)
then 408 if (cs%debugConservation)
call mom_state_stats(
'1st make_frazil', u, v, h, tv%T, tv%S, g)
410 if ((cs%ML_mix_first > 0.0) .or. cs%use_geothermal)
then 412 do k=1,nz ;
do j=js,je ;
do i=is,ie
413 h_orig(i,j,k) = h(i,j,k) ; eaml(i,j,k) = 0.0 ; ebml(i,j,k) = 0.0
414 enddo ;
enddo ;
enddo 417 if (cs%use_geothermal)
then 419 call geothermal(h, tv, dt, eaml, ebml, g, gv, cs%geothermal_CSp)
422 if (cs%debugConservation)
call mom_state_stats(
'geothermal', u, v, h, tv%T, tv%S, g)
428 call diag_update_remap_grids(cs%diag)
433 if (
associated(cs%optics)) &
434 call set_opacity(cs%optics, fluxes, g, gv, cs%opacity_CSp)
436 if (cs%bulkmixedlayer)
then 438 call mom_forcing_chksum(
"Before mixedlayer", fluxes, g, haloshift=0)
441 if (cs%ML_mix_first > 0.0)
then 452 if (cs%ML_mix_first < 1.0)
then 454 call bulkmixedlayer(h, u_h, v_h, tv, fluxes, dt*cs%ML_mix_first, &
455 eaml,ebml, g, gv, cs%bulkmixedlayer_CSp, cs%optics, &
456 hml, cs%aggregate_FW_forcing, dt, last_call=.false.)
457 if (cs%salt_reject_below_ML) &
458 call insert_brine(h, tv, g, gv, fluxes, nkmb, cs%diabatic_aux_CSp, &
459 dt*cs%ML_mix_first, cs%id_brine_lay)
463 g, gv, cs%bulkmixedlayer_CSp, cs%optics, &
464 hml, cs%aggregate_FW_forcing, dt, last_call=.true.)
473 if (
ASSOCIATED(tv%S) .and.
ASSOCIATED(tv%salt_deficit)) &
474 call adjust_salt(h, tv, g, gv, cs%diabatic_aux_CSp)
478 call mom_forcing_chksum(
"After mixedlayer", fluxes, g, haloshift=0)
480 if (showcalltree)
call calltree_waypoint(
"done with 1st bulkmixedlayer (diabatic)")
481 if (cs%debugConservation)
call mom_state_stats(
'1st bulkmixedlayer', u, v, h, tv%T, tv%S, g)
488 if (cs%use_kappa_shear .or. cs%use_CVMix_shear)
then 489 if ((cs%ML_mix_first > 0.0) .or. cs%use_geothermal)
then 490 call find_uv_at_h(u, v, h_orig, u_h, v_h, g, gv, eaml, ebml)
492 call hchksum(eaml,
"after find_uv_at_h eaml",g%HI, scale=gv%H_to_m)
493 call hchksum(ebml,
"after find_uv_at_h ebml",g%HI, scale=gv%H_to_m)
501 if (cs%use_int_tides)
then 506 call set_int_tide_input(u, v, h, tv, fluxes, cs%int_tide_input, dt, g, gv, &
507 cs%int_tide_input_CSp)
510 if (cs%uniform_cg)
then 512 do m=1,cs%nMode ; cn(:,:,m) = cs%cg_test ;
enddo 514 call wave_speeds(h, tv, g, gv, cs%nMode, cn, full_halos=.true.)
521 if (cs%int_tide_source_test)
then 524 tke_itidal_input_test(:,:) = 0.0
526 if (cs%time_end <= cs%time_max_source)
then 527 do j=g%jsc,g%jec ;
do i=g%isc,g%iec
529 if ((g%idg_offset + i == cs%int_tide_source_x) .and. &
530 (g%jdg_offset + j == cs%int_tide_source_y))
then 531 tke_itidal_input_test(i,j) = 1.0
536 call propagate_int_tide(h, tv, cn, tke_itidal_input_test, &
537 cs%int_tide_input%tideamp, cs%int_tide_input%Nb, dt, g, gv, cs%int_tide_CSp)
540 call propagate_int_tide(h, tv, cn, cs%int_tide_input%TKE_itidal_input, &
541 cs%int_tide_input%tideamp, cs%int_tide_input%Nb, dt, g, gv, cs%int_tide_CSp)
543 if (showcalltree)
call calltree_waypoint(
"done with propagate_int_tide (diabatic)")
550 call set_diffusivity(u, v, h, u_h, v_h, tv, fluxes, cs%optics, visc, dt, g, gv, cs%set_diff_CSp, kd, kd_int)
555 call mom_state_chksum(
"after set_diffusivity ", u, v, h, g, gv, haloshift=0)
556 call mom_forcing_chksum(
"after set_diffusivity ", fluxes, g, haloshift=0)
558 call hchksum(kd,
"after set_diffusivity Kd",g%HI,haloshift=0)
559 call hchksum(kd_int,
"after set_diffusivity Kd_Int",g%HI,haloshift=0)
571 cs%KPP_buoy_flux, cs%KPP_temp_flux, cs%KPP_salt_flux)
579 do k=1,nz+1 ;
do j=js,je ;
do i=is,ie
580 kd_salt(i,j,k) = kd_int(i,j,k)
581 kd_heat(i,j,k) = kd_int(i,j,k)
582 enddo ;
enddo ;
enddo 583 if (
associated(visc%Kd_extra_S))
then 585 do k=1,nz+1 ;
do j=js,je ;
do i=is,ie
586 kd_salt(i,j,k) = kd_salt(i,j,k) + visc%Kd_extra_S(i,j,k)
587 enddo ;
enddo ;
enddo 589 if (
associated(visc%Kd_extra_T))
then 591 do k=1,nz+1 ;
do j=js,je ;
do i=is,ie
592 kd_heat(i,j,k) = kd_heat(i,j,k) + visc%Kd_extra_T(i,j,k)
593 enddo ;
enddo ;
enddo 597 call kpp_calculate(cs%KPP_CSp, g, gv, h, tv%T, tv%S, u, v, tv%eqn_of_state, &
598 fluxes%ustar, cs%KPP_buoy_flux, kd_heat, kd_salt, visc%Kv_turb, cs%KPP_NLTheat, cs%KPP_NLTscalar)
601 if (.not. cs%KPPisPassive)
then 603 do k=1,nz+1 ;
do j=js,je ;
do i=is,ie
604 kd_int(i,j,k) = min( kd_salt(i,j,k), kd_heat(i,j,k) )
605 enddo ;
enddo ;
enddo 606 if (
associated(visc%Kd_extra_S))
then 608 do k=1,nz+1 ;
do j=js,je ;
do i=is,ie
609 visc%Kd_extra_S(i,j,k) = kd_salt(i,j,k) - kd_int(i,j,k)
610 enddo ;
enddo ;
enddo 612 if (
associated(visc%Kd_extra_T))
then 614 do k=1,nz+1 ;
do j=js,je ;
do i=is,ie
615 visc%Kd_extra_T(i,j,k) = kd_heat(i,j,k) - kd_int(i,j,k)
616 enddo ;
enddo ;
enddo 624 call mom_forcing_chksum(
"after KPP", fluxes, g, haloshift=0)
626 call hchksum(kd,
"after KPP Kd",g%HI,haloshift=0)
627 call hchksum(kd_int,
"after KPP Kd_Int",g%HI,haloshift=0)
634 g, gv, h, tv%T, tv%S, tv%eqn_of_state, kd_int)
640 call hchksum(cs%KPP_temp_flux,
"before KPP_applyNLT netHeat",g%HI,haloshift=0, scale=gv%H_to_m)
641 call hchksum(cs%KPP_salt_flux,
"before KPP_applyNLT netSalt",g%HI,haloshift=0, scale=gv%H_to_m)
642 call hchksum(cs%KPP_NLTheat,
"before KPP_applyNLT NLTheat",g%HI,haloshift=0)
643 call hchksum(cs%KPP_NLTscalar,
"before KPP_applyNLT NLTscalar",g%HI,haloshift=0)
650 if (showcalltree)
call calltree_waypoint(
"done with KPP_applyNonLocalTransport (diabatic)")
651 if (cs%debugConservation)
call mom_state_stats(
'KPP_applyNonLocalTransport', u, v, h, tv%T, tv%S, g)
655 call mom_forcing_chksum(
"after KPP_applyNLT ", fluxes, g, haloshift=0)
666 if (
associated(visc%Kd_extra_T) .and.
associated(visc%Kd_extra_S) .and.
associated(tv%T))
then 669 call differential_diffuse_t_s(h, tv, visc, dt, g, gv)
671 if (showcalltree)
call calltree_waypoint(
"done with differential_diffuse_T_S (diabatic)")
672 if (cs%debugConservation)
call mom_state_stats(
'differential_diffuse_T_S', u, v, h, tv%T, tv%S, g)
676 if(.not. cs%useKPP)
then 677 do k=2,nz ;
do j=js,je ;
do i=is,ie
678 kd_heat(i,j,k) = kd_heat(i,j,k) + visc%Kd_extra_T(i,j,k)
679 kd_salt(i,j,k) = kd_salt(i,j,k) + visc%Kd_extra_S(i,j,k)
680 enddo ;
enddo ;
enddo 692 if (cs%useALEalgorithm)
then 694 do j=js,je ;
do i=is,ie
699 do k=2,nz ;
do j=js,je ;
do i=is,ie
700 hval=1.0/(h_neglect + 0.5*(h(i,j,k-1) + h(i,j,k)))
701 ea(i,j,k) = (gv%m_to_H**2) * dt * hval * kd_int(i,j,k)
702 eb(i,j,k-1) = ea(i,j,k)
703 enddo ;
enddo ;
enddo 704 do j=js,je ;
do i=is,ie
707 if (showcalltree)
call calltree_waypoint(
"done setting ea,eb from Kd_int (diabatic)")
715 call entrainment_diffusive(u, v, h, tv, fluxes, dt, g, gv, cs%entrain_diffusive_CSp, &
716 ea, eb, kb, kd_lay=kd, kd_int=kd_int)
718 if (showcalltree)
call calltree_waypoint(
"done with Entrainment_diffusive (diabatic)")
723 call mom_forcing_chksum(
"after calc_entrain ", fluxes, g, haloshift=0)
726 call hchksum(ea,
"after calc_entrain ea", g%HI, haloshift=0, scale=gv%H_to_m)
727 call hchksum(eb,
"after calc_entrain eb", g%HI, haloshift=0, scale=gv%H_to_m)
731 if (cs%useALEalgorithm)
then 737 if(cs%boundary_forcing_tendency_diag)
then 738 do k=1,nz ;
do j=js,je ;
do i=is,ie
739 h_diag(i,j,k) = h(i,j,k)
740 temp_diag(i,j,k) = tv%T(i,j,k)
741 saln_diag(i,j,k) = tv%S(i,j,k)
742 enddo ;
enddo ;
enddo 745 do k=1,nz ;
do j=js,je ;
do i=is,ie
746 h_prebound(i,j,k) = h(i,j,k)
747 enddo ;
enddo ;
enddo 748 if (cs%use_energetic_PBL)
then 750 skinbuoyflux(:,:) = 0.0
752 h, tv, cs%aggregate_FW_forcing, cs%evap_CFL_limit, &
753 cs%minimum_forcing_depth, ctke, dsv_dt, dsv_ds, skinbuoyflux=skinbuoyflux)
756 call hchksum(ea,
"after applyBoundaryFluxes ea",g%HI,haloshift=0, scale=gv%H_to_m)
757 call hchksum(eb,
"after applyBoundaryFluxes eb",g%HI,haloshift=0, scale=gv%H_to_m)
758 call hchksum(ctke,
"after applyBoundaryFluxes cTKE",g%HI,haloshift=0)
759 call hchksum(dsv_dt,
"after applyBoundaryFluxes dSV_dT",g%HI,haloshift=0)
760 call hchksum(dsv_ds,
"after applyBoundaryFluxes dSV_dS",g%HI,haloshift=0)
764 call energetic_pbl(h, u_h, v_h, tv, fluxes, dt, kd_epbl, g, gv, &
765 cs%energetic_PBL_CSp, dsv_dt, dsv_ds, ctke, skinbuoyflux)
768 if (
associated(visc%MLD))
then 770 call pass_var(visc%MLD, g%domain, halo=1)
771 hml(:,:) = visc%MLD(:,:)
775 do k=2,nz ;
do j=js,je ;
do i=is,ie
777 if (cs%ePBL_is_additive)
then 778 kd_add_here = kd_epbl(i,j,k)
779 visc%Kv_turb(i,j,k) = visc%Kv_turb(i,j,k) + kd_epbl(i,j,k)
781 kd_add_here = max(kd_epbl(i,j,k) - visc%Kd_turb(i,j,k), 0.0)
782 visc%Kv_turb(i,j,k) = max(visc%Kv_turb(i,j,k), kd_epbl(i,j,k))
784 ent_int = kd_add_here * (gv%m_to_H**2 * dt) / &
785 (0.5*(h(i,j,k-1) + h(i,j,k)) + h_neglect)
786 eb(i,j,k-1) = eb(i,j,k-1) + ent_int
787 ea(i,j,k) = ea(i,j,k) + ent_int
788 kd_int(i,j,k) = kd_int(i,j,k) + kd_add_here
791 kd_heat(i,j,k) = kd_heat(i,j,k) + kd_int(i,j,k)
792 kd_salt(i,j,k) = kd_salt(i,j,k) + kd_int(i,j,k)
794 enddo ;
enddo ;
enddo 797 call hchksum(ea,
"after ePBL ea",g%HI,haloshift=0, scale=gv%H_to_m)
798 call hchksum(eb,
"after ePBL eb",g%HI,haloshift=0, scale=gv%H_to_m)
799 call hchksum(kd_epbl,
"after ePBL Kd_ePBL",g%HI,haloshift=0)
804 h, tv, cs%aggregate_FW_forcing, &
805 cs%evap_CFL_limit, cs%minimum_forcing_depth)
810 if(cs%boundary_forcing_tendency_diag)
then 816 call mom_forcing_chksum(
"after applyBoundaryFluxes ", fluxes, g, haloshift=0)
818 call mom_state_chksum(
"after applyBoundaryFluxes ", u, v, h, g, gv, haloshift=0)
820 if (showcalltree)
call calltree_waypoint(
"done with applyBoundaryFluxes (diabatic)")
821 if (cs%debugConservation)
call mom_state_stats(
'applyBoundaryFluxes', u, v, h, tv%T, tv%S, g)
836 hold(i,j,1) = h(i,j,1)
837 h(i,j,1) = h(i,j,1) + (eb(i,j,1) - ea(i,j,2))
838 hold(i,j,nz) = h(i,j,nz)
839 h(i,j,nz) = h(i,j,nz) + (ea(i,j,nz) - eb(i,j,nz-1))
840 if (h(i,j,1) <= 0.0)
then 841 h(i,j,1) = gv%Angstrom
843 if (h(i,j,nz) <= 0.0)
then 844 h(i,j,nz) = gv%Angstrom
847 do k=2,nz-1 ;
do i=is,ie
848 hold(i,j,k) = h(i,j,k)
849 h(i,j,k) = h(i,j,k) + ((ea(i,j,k) - eb(i,j,k-1)) + &
850 (eb(i,j,k) - ea(i,j,k+1)))
851 if (h(i,j,k) <= 0.0)
then 852 h(i,j,k) = gv%Angstrom
858 call mom_forcing_chksum(
"after negative check ", fluxes, g, haloshift=0)
862 if (cs%debugConservation)
call mom_state_stats(
'h=ea-eb', u, v, h, tv%T, tv%S, g)
869 if (cs%bulkmixedlayer)
then 871 if (
ASSOCIATED(tv%T))
then 877 if (cs%massless_match_targets)
then 882 h_tr = hold(i,j,1) + h_neglect
883 b1(i) = 1.0 / (h_tr + eb(i,j,1))
885 tv%T(i,j,1) = b1(i) * (h_tr*tv%T(i,j,1))
886 tv%S(i,j,1) = b1(i) * (h_tr*tv%S(i,j,1))
888 do k=2,nkmb ;
do i=is,ie
889 c1(i,k) = eb(i,j,k-1) * b1(i)
890 h_tr = hold(i,j,k) + h_neglect
891 b_denom_1 = h_tr + d1(i)*ea(i,j,k)
892 b1(i) = 1.0 / (b_denom_1 + eb(i,j,k))
893 if (k<nkmb) d1(i) = b_denom_1 * b1(i)
894 tv%T(i,j,k) = b1(i) * (h_tr*tv%T(i,j,k) + ea(i,j,k)*tv%T(i,j,k-1))
895 tv%S(i,j,k) = b1(i) * (h_tr*tv%S(i,j,k) + ea(i,j,k)*tv%S(i,j,k-1))
898 do k=nkmb+1,nz ;
do i=is,ie
899 if (k == kb(i,j))
then 900 c1(i,k) = eb(i,j,k-1) * b1(i)
901 d1(i) = (((eb(i,j,nkmb)-eb(i,j,k-1)) + hold(i,j,nkmb) + h_neglect) + &
902 d1(i)*ea(i,j,nkmb)) * b1(i)
903 h_tr = hold(i,j,k) + h_neglect
904 b_denom_1 = h_tr + d1(i)*ea(i,j,k)
905 b1(i) = 1.0 / (b_denom_1 + eb(i,j,k))
906 d1(i) = b_denom_1 * b1(i)
907 tv%T(i,j,k) = b1(i) * (h_tr*tv%T(i,j,k) + ea(i,j,k)*tv%T(i,j,nkmb))
908 tv%S(i,j,k) = b1(i) * (h_tr*tv%S(i,j,k) + ea(i,j,k)*tv%S(i,j,nkmb))
909 elseif (k > kb(i,j))
then 910 c1(i,k) = eb(i,j,k-1) * b1(i)
911 h_tr = hold(i,j,k) + h_neglect
912 b_denom_1 = h_tr + d1(i)*ea(i,j,k)
913 b1(i) = 1.0 / (b_denom_1 + eb(i,j,k))
914 d1(i) = b_denom_1 * b1(i)
915 tv%T(i,j,k) = b1(i) * (h_tr*tv%T(i,j,k) + ea(i,j,k)*tv%T(i,j,k-1))
916 tv%S(i,j,k) = b1(i) * (h_tr*tv%S(i,j,k) + ea(i,j,k)*tv%S(i,j,k-1))
917 elseif (eb(i,j,k) < eb(i,j,k-1))
then 922 tv%T(i,j,nkmb) = tv%T(i,j,nkmb) + b1(i) * (eb(i,j,k-1) - eb(i,j,k)) * tv%T(i,j,k)
923 tv%S(i,j,nkmb) = tv%S(i,j,nkmb) + b1(i) * (eb(i,j,k-1) - eb(i,j,k)) * tv%S(i,j,k)
927 do k=nz-1,nkmb,-1 ;
do i=is,ie
928 if (k >= kb(i,j))
then 929 tv%T(i,j,k) = tv%T(i,j,k) + c1(i,k+1)*tv%T(i,j,k+1)
930 tv%S(i,j,k) = tv%S(i,j,k) + c1(i,k+1)*tv%S(i,j,k+1)
933 do i=is,ie ;
if (kb(i,j) <= nz)
then 934 tv%T(i,j,nkmb) = tv%T(i,j,nkmb) + c1(i,kb(i,j))*tv%T(i,j,kb(i,j))
935 tv%S(i,j,nkmb) = tv%S(i,j,nkmb) + c1(i,kb(i,j))*tv%S(i,j,kb(i,j))
937 do k=nkmb-1,1,-1 ;
do i=is,ie
938 tv%T(i,j,k) = tv%T(i,j,k) + c1(i,k+1)*tv%T(i,j,k+1)
939 tv%S(i,j,k) = tv%S(i,j,k) + c1(i,k+1)*tv%S(i,j,k+1)
946 if (cs%tracer_tridiag)
then 950 call tridiagts(g, gv, is, ie, js, je, hold, ea, eb, tv%T, tv%S)
956 if (cs%debugConservation)
call mom_state_stats(
'BML tridiag', u, v, h, tv%T, tv%S, g)
958 if ((cs%ML_mix_first > 0.0) .or. cs%use_geothermal)
then 962 do k=1,nz ;
do j=js,je ;
do i=is,ie
963 hold(i,j,k) = h_orig(i,j,k)
964 ea(i,j,k) = ea(i,j,k) + eaml(i,j,k)
965 eb(i,j,k) = eb(i,j,k) + ebml(i,j,k)
966 enddo ;
enddo ;
enddo 968 call hchksum(ea,
"after ea = ea + eaml",g%HI,haloshift=0, scale=gv%H_to_m)
969 call hchksum(eb,
"after eb = eb + ebml",g%HI,haloshift=0, scale=gv%H_to_m)
973 if (cs%ML_mix_first < 1.0)
then 983 if (cs%debug)
call mom_state_chksum(
"find_uv_at_h1 ", u, v, h, g, gv, haloshift=0)
985 dt_mix = min(dt,dt*(1.0 - cs%ML_mix_first))
989 g, gv, cs%bulkmixedlayer_CSp, cs%optics, &
990 hml, cs%aggregate_FW_forcing, dt, last_call=.true.)
992 if (cs%salt_reject_below_ML) &
993 call insert_brine(h, tv, g, gv, fluxes, nkmb, cs%diabatic_aux_CSp, dt_mix, &
1002 if (
ASSOCIATED(tv%S) .and.
ASSOCIATED(tv%salt_deficit)) &
1003 call adjust_salt(h, tv, g, gv, cs%diabatic_aux_CSp)
1006 if (showcalltree)
call calltree_waypoint(
"done with 2nd bulkmixedlayer (diabatic)")
1007 if (cs%debugConservation)
call mom_state_stats(
'2nd bulkmixedlayer', u, v, h, tv%T, tv%S, g)
1014 if (
ASSOCIATED(tv%T))
then 1017 call hchksum(ea,
"before triDiagTS ea ",g%HI,haloshift=0, scale=gv%H_to_m)
1018 call hchksum(eb,
"before triDiagTS eb ",g%HI,haloshift=0, scale=gv%H_to_m)
1022 if(cs%diabatic_diff_tendency_diag)
then 1023 do k=1,nz ;
do j=js,je ;
do i=is,ie
1024 temp_diag(i,j,k) = tv%T(i,j,k)
1025 saln_diag(i,j,k) = tv%S(i,j,k)
1026 enddo ;
enddo ;
enddo 1030 if(cs%tracer_tridiag)
then 1034 call tridiagts(g, gv, is, ie, js, je, hold, ea, eb, tv%T, tv%S)
1038 if(cs%diabatic_diff_tendency_diag)
then 1046 if (cs%debugConservation)
call mom_state_stats(
'triDiagTS', u, v, h, tv%T, tv%S, g)
1055 call hchksum(ea,
"after mixed layer ea", g%HI, scale=gv%H_to_m)
1056 call hchksum(eb,
"after mixed layer eb", g%HI, scale=gv%H_to_m)
1059 if (.not. cs%useALEalgorithm)
then 1063 if (showcalltree)
call calltree_waypoint(
"done with regularize_layers (diabatic)")
1064 if (cs%debugConservation)
call mom_state_stats(
'regularize_layers', u, v, h, tv%T, tv%S, g)
1069 call diag_update_remap_grids(cs%diag)
1072 if ((cs%id_Tdif > 0) .or. (cs%id_Tdif_z > 0) .or. &
1073 (cs%id_Tadv > 0) .or. (cs%id_Tadv_z > 0))
then 1074 do j=js,je ;
do i=is,ie
1075 tdif_flx(i,j,1) = 0.0 ; tdif_flx(i,j,nz+1) = 0.0
1076 tadv_flx(i,j,1) = 0.0 ; tadv_flx(i,j,nz+1) = 0.0
1079 do k=2,nz ;
do j=js,je ;
do i=is,ie
1080 tdif_flx(i,j,k) = (idt * 0.5*(ea(i,j,k) + eb(i,j,k-1))) * &
1081 (tv%T(i,j,k-1) - tv%T(i,j,k))
1082 tadv_flx(i,j,k) = (idt * (ea(i,j,k) - eb(i,j,k-1))) * &
1083 0.5*(tv%T(i,j,k-1) + tv%T(i,j,k))
1084 enddo ;
enddo ;
enddo 1086 if ((cs%id_Sdif > 0) .or. (cs%id_Sdif_z > 0) .or. &
1087 (cs%id_Sadv > 0) .or. (cs%id_Sadv_z > 0))
then 1088 do j=js,je ;
do i=is,ie
1089 sdif_flx(i,j,1) = 0.0 ; sdif_flx(i,j,nz+1) = 0.0
1090 sadv_flx(i,j,1) = 0.0 ; sadv_flx(i,j,nz+1) = 0.0
1093 do k=2,nz ;
do j=js,je ;
do i=is,ie
1094 sdif_flx(i,j,k) = (idt * 0.5*(ea(i,j,k) + eb(i,j,k-1))) * &
1095 (tv%S(i,j,k-1) - tv%S(i,j,k))
1096 sadv_flx(i,j,k) = (idt * (ea(i,j,k) - eb(i,j,k-1))) * &
1097 0.5*(tv%S(i,j,k-1) + tv%S(i,j,k))
1098 enddo ;
enddo ;
enddo 1103 if (cs%mix_boundary_tracers)
then 1104 tr_ea_bbl = sqrt(dt*cs%Kd_BBL_tr)
1110 ebtr(i,j,nz) = eb(i,j,nz)
1112 in_boundary(i) = (g%mask2dT(i,j) > 0.0)
1114 do k=nz,2,-1 ;
do i=is,ie
1115 if (in_boundary(i))
then 1116 htot(i) = htot(i) + h(i,j,k)
1125 add_ent = ((dt * cs%Kd_min_tr) * gv%m_to_H**2) * &
1126 ((h(i,j,k-1)+h(i,j,k)+h_neglect) / &
1127 (h(i,j,k-1)*h(i,j,k)+h_neglect2)) - &
1128 0.5*(ea(i,j,k) + eb(i,j,k-1))
1129 if (htot(i) < tr_ea_bbl)
then 1130 add_ent = max(0.0, add_ent, &
1131 (tr_ea_bbl - htot(i)) - min(ea(i,j,k),eb(i,j,k-1)))
1132 elseif (add_ent < 0.0)
then 1133 add_ent = 0.0 ; in_boundary(i) = .false.
1136 ebtr(i,j,k-1) = eb(i,j,k-1) + add_ent
1137 eatr(i,j,k) = ea(i,j,k) + add_ent
1139 ebtr(i,j,k-1) = eb(i,j,k-1) ; eatr(i,j,k) = ea(i,j,k)
1141 if (
associated(visc%Kd_extra_S))
then ;
if (visc%Kd_extra_S(i,j,k) > 0.0)
then 1142 add_ent = ((dt * visc%Kd_extra_S(i,j,k)) * gv%m_to_H**2) / &
1143 (0.25 * ((h(i,j,k-1) + h(i,j,k)) + (hold(i,j,k-1) + hold(i,j,k))) + &
1145 ebtr(i,j,k-1) = ebtr(i,j,k-1) + add_ent
1146 eatr(i,j,k) = eatr(i,j,k) + add_ent
1149 do i=is,ie ; eatr(i,j,1) = ea(i,j,1) ;
enddo 1153 if (cs%useALEalgorithm)
then 1156 call call_tracer_column_fns(h_prebound, h, ea, eb, fluxes, hml, dt, g, gv, tv, &
1157 cs%optics, cs%tracer_flow_CSp, cs%debug, &
1158 evap_cfl_limit = cs%evap_CFL_limit, &
1159 minimum_forcing_depth = cs%minimum_forcing_depth)
1161 call call_tracer_column_fns(hold, h, eatr, ebtr, fluxes, hml, dt, g, gv, tv, &
1162 cs%optics, cs%tracer_flow_CSp, cs%debug)
1165 elseif (
associated(visc%Kd_extra_S))
then 1167 do j=js,je ;
do i=is,ie
1168 ebtr(i,j,nz) = eb(i,j,nz) ; eatr(i,j,1) = ea(i,j,1)
1173 do k=nz,2,-1 ;
do j=js,je ;
do i=is,ie
1174 if (visc%Kd_extra_S(i,j,k) > 0.0)
then 1175 add_ent = ((dt * visc%Kd_extra_S(i,j,k)) * gv%m_to_H**2) / &
1176 (0.25 * ((h(i,j,k-1) + h(i,j,k)) + (hold(i,j,k-1) + hold(i,j,k))) + &
1181 ebtr(i,j,k-1) = eb(i,j,k-1) + add_ent
1182 eatr(i,j,k) = ea(i,j,k) + add_ent
1183 enddo ;
enddo ;
enddo 1185 if (cs%useALEalgorithm)
then 1187 call call_tracer_column_fns(h_prebound, h, eatr, ebtr, fluxes, hml, dt, g, gv, tv, &
1188 cs%optics, cs%tracer_flow_CSp, cs%debug,&
1189 evap_cfl_limit = cs%evap_CFL_limit, &
1190 minimum_forcing_depth = cs%minimum_forcing_depth)
1192 call call_tracer_column_fns(hold, h, eatr, ebtr, fluxes, hml, dt, g, gv, tv, &
1193 cs%optics, cs%tracer_flow_CSp, cs%debug)
1197 if (cs%useALEalgorithm)
then 1199 call call_tracer_column_fns(h_prebound, h, eatr, ebtr, fluxes, hml, dt, g, gv, tv, &
1200 cs%optics, cs%tracer_flow_CSp, cs%debug, &
1201 evap_cfl_limit = cs%evap_CFL_limit, &
1202 minimum_forcing_depth = cs%minimum_forcing_depth)
1204 call call_tracer_column_fns(hold, h, ea, eb, fluxes, hml, dt, g, gv, tv, &
1205 cs%optics, cs%tracer_flow_CSp, cs%debug)
1216 if (cs%use_sponge)
then 1218 if (
associated(cs%ALE_sponge_CSp))
then 1223 if (cs%bulkmixedlayer .and.
ASSOCIATED(tv%eqn_of_state))
then 1224 do i=is,ie ; p_ref_cv(i) = tv%P_Ref ;
enddo 1228 is, ie-is+1, tv%eqn_of_state)
1230 call apply_sponge(h, dt, g, gv, ea, eb, cs%sponge_CSp, rcv_ml)
1245 if (
ASSOCIATED(cdp%diapyc_vel))
then 1248 do k=2,nz ;
do i=is,ie
1249 cdp%diapyc_vel(i,j,k) = idt * (gv%H_to_m * (ea(i,j,k) - eb(i,j,k-1)))
1252 cdp%diapyc_vel(i,j,1) = 0.0
1253 cdp%diapyc_vel(i,j,nz+1) = 0.0
1261 if (cs%bulkmixedlayer)
then 1263 call hchksum(ea,
"before net flux rearrangement ea",g%HI, scale=gv%H_to_m)
1264 call hchksum(eb,
"before net flux rearrangement eb",g%HI, scale=gv%H_to_m)
1268 do k=2,gv%nkml ;
do i=is,ie
1269 net_ent = ea(i,j,k) - eb(i,j,k-1)
1270 ea(i,j,k) = max(net_ent, 0.0)
1271 eb(i,j,k-1) = max(-net_ent, 0.0)
1275 call hchksum(ea,
"after net flux rearrangement ea",g%HI, scale=gv%H_to_m)
1276 call hchksum(eb,
"after net flux rearrangement eb",g%HI, scale=gv%H_to_m)
1285 hold(i,js-1,k) = gv%Angstrom ; ea(i,js-1,k) = 0.0 ; eb(i,js-1,k) = 0.0
1286 hold(i,je+1,k) = gv%Angstrom ; ea(i,je+1,k) = 0.0 ; eb(i,je+1,k) = 0.0
1289 hold(is-1,j,k) = gv%Angstrom ; ea(is-1,j,k) = 0.0 ; eb(is-1,j,k) = 0.0
1290 hold(ie+1,j,k) = gv%Angstrom ; ea(ie+1,j,k) = 0.0 ; eb(ie+1,j,k) = 0.0
1296 if (g%symmetric)
then 1297 call create_group_pass(cs%pass_hold_eb_ea,hold,g%Domain,to_all+omit_corners,halo=1)
1298 call create_group_pass(cs%pass_hold_eb_ea,eb,g%Domain,to_all+omit_corners,halo=1)
1299 call create_group_pass(cs%pass_hold_eb_ea,ea,g%Domain,to_all+omit_corners,halo=1)
1301 call create_group_pass(cs%pass_hold_eb_ea,hold,g%Domain,to_west+to_south+omit_corners,halo=1)
1302 call create_group_pass(cs%pass_hold_eb_ea,eb,g%Domain,to_west+to_south+omit_corners,halo=1)
1303 call create_group_pass(cs%pass_hold_eb_ea,ea,g%Domain,to_west+to_south+omit_corners,halo=1)
1308 if (.not. cs%useALEalgorithm)
then 1314 call hchksum(ea,
"before u/v tridiag ea",g%HI, scale=gv%H_to_m)
1315 call hchksum(eb,
"before u/v tridiag eb",g%HI, scale=gv%H_to_m)
1316 call hchksum(hold,
"before u/v tridiag hold",g%HI, scale=gv%H_to_m)
1323 if (
ASSOCIATED(adp%du_dt_dia)) adp%du_dt_dia(i,j,1) = u(i,j,1)
1324 hval = (hold(i,j,1) + hold(i+1,j,1)) + (ea(i,j,1) + ea(i+1,j,1)) + h_neglect
1325 b1(i) = 1.0 / (hval + (eb(i,j,1) + eb(i+1,j,1)))
1326 d1(i) = hval * b1(i)
1327 u(i,j,1) = b1(i) * (hval * u(i,j,1))
1329 do k=2,nz ;
do i=isq,ieq
1330 if (
ASSOCIATED(adp%du_dt_dia)) adp%du_dt_dia(i,j,k) = u(i,j,k)
1331 c1(i,k) = (eb(i,j,k-1)+eb(i+1,j,k-1)) * b1(i)
1332 eaval = ea(i,j,k) + ea(i+1,j,k)
1333 hval = hold(i,j,k) + hold(i+1,j,k) + h_neglect
1334 b1(i) = 1.0 / ((eb(i,j,k) + eb(i+1,j,k)) + (hval + d1(i)*eaval))
1335 d1(i) = (hval + d1(i)*eaval) * b1(i)
1336 u(i,j,k) = (hval*u(i,j,k) + eaval*u(i,j,k-1))*b1(i)
1338 do k=nz-1,1,-1 ;
do i=isq,ieq
1339 u(i,j,k) = u(i,j,k) + c1(i,k+1)*u(i,j,k+1)
1340 if (
ASSOCIATED(adp%du_dt_dia)) &
1341 adp%du_dt_dia(i,j,k) = (u(i,j,k) - adp%du_dt_dia(i,j,k)) * idt
1343 if (
ASSOCIATED(adp%du_dt_dia))
then 1345 adp%du_dt_dia(i,j,nz) = (u(i,j,nz)-adp%du_dt_dia(i,j,nz)) * idt
1350 call mom_state_chksum(
"aft 1st loop tridiag ", u, v, h, g, gv, haloshift=0)
1356 if (
ASSOCIATED(adp%dv_dt_dia)) adp%dv_dt_dia(i,j,1) = v(i,j,1)
1357 hval = (hold(i,j,1) + hold(i,j+1,1)) + (ea(i,j,1) + ea(i,j+1,1)) + h_neglect
1358 b1(i) = 1.0 / (hval + (eb(i,j,1) + eb(i,j+1,1)))
1359 d1(i) = hval * b1(i)
1360 v(i,j,1) = b1(i) * (hval * v(i,j,1))
1362 do k=2,nz ;
do i=is,ie
1363 if (
ASSOCIATED(adp%dv_dt_dia)) adp%dv_dt_dia(i,j,k) = v(i,j,k)
1364 c1(i,k) = (eb(i,j,k-1)+eb(i,j+1,k-1)) * b1(i)
1365 eaval = ea(i,j,k) + ea(i,j+1,k)
1366 hval = hold(i,j,k) + hold(i,j+1,k) + h_neglect
1367 b1(i) = 1.0 / ((eb(i,j,k) + eb(i,j+1,k)) + (hval + d1(i)*eaval))
1368 d1(i) = (hval + d1(i)*eaval) * b1(i)
1369 v(i,j,k) = (hval*v(i,j,k) + eaval*v(i,j,k-1))*b1(i)
1371 do k=nz-1,1,-1 ;
do i=is,ie
1372 v(i,j,k) = v(i,j,k) + c1(i,k+1)*v(i,j,k+1)
1373 if (
ASSOCIATED(adp%dv_dt_dia)) &
1374 adp%dv_dt_dia(i,j,k) = (v(i,j,k) - adp%dv_dt_dia(i,j,k)) * idt
1376 if (
ASSOCIATED(adp%dv_dt_dia))
then 1378 adp%dv_dt_dia(i,j,nz) = (v(i,j,nz)-adp%dv_dt_dia(i,j,nz)) * idt
1391 if (
ASSOCIATED(tv%T) .AND.
ASSOCIATED(tv%frazil))
then 1393 if(cs%frazil_tendency_diag)
then 1394 do k=1,nz ;
do j=js,je ;
do i=is,ie
1395 temp_diag(i,j,k) = tv%T(i,j,k)
1396 enddo ;
enddo ;
enddo 1399 if (
ASSOCIATED(fluxes%p_surf_full))
then 1400 call make_frazil(h, tv, g, gv, cs%diabatic_aux_CSp, fluxes%p_surf_full)
1402 call make_frazil(h, tv, g, gv, cs%diabatic_aux_CSp)
1405 if (cs%frazil_tendency_diag)
then 1409 if (showcalltree)
call calltree_waypoint(
"done with 2nd make_frazil (diabatic)")
1410 if (cs%debugConservation)
call mom_state_stats(
'2nd make_frazil', u, v, h, tv%T, tv%S, g)
1416 if (cs%id_Kd_interface > 0)
call post_data(cs%id_Kd_interface, kd_int, cs%diag)
1417 if (cs%id_Kd_heat > 0)
call post_data(cs%id_Kd_heat, kd_heat, cs%diag)
1418 if (cs%id_Kd_salt > 0)
call post_data(cs%id_Kd_salt, kd_salt, cs%diag)
1419 if (cs%id_Kd_ePBL > 0)
call post_data(cs%id_Kd_ePBL, kd_epbl, cs%diag)
1421 if (cs%id_ea > 0)
call post_data(cs%id_ea, ea, cs%diag)
1422 if (cs%id_eb > 0)
call post_data(cs%id_eb, eb, cs%diag)
1424 if (cs%id_dudt_dia > 0)
call post_data(cs%id_dudt_dia, adp%du_dt_dia, cs%diag)
1425 if (cs%id_dvdt_dia > 0)
call post_data(cs%id_dvdt_dia, adp%dv_dt_dia, cs%diag)
1426 if (cs%id_wd > 0)
call post_data(cs%id_wd, cdp%diapyc_vel, cs%diag)
1428 if (cs%id_MLD_003 > 0 .or. cs%id_subMLN2 > 0 .or. cs%id_mlotstsq > 0)
then 1430 id_n2subml=cs%id_subMLN2, id_mldsq=cs%id_mlotstsq)
1432 if (cs%id_MLD_0125 > 0)
then 1435 if (cs%id_MLD_user > 0)
then 1439 if (cs%id_Tdif > 0)
call post_data(cs%id_Tdif, tdif_flx, cs%diag)
1440 if (cs%id_Tadv > 0)
call post_data(cs%id_Tadv, tadv_flx, cs%diag)
1441 if (cs%id_Sdif > 0)
call post_data(cs%id_Sdif, sdif_flx, cs%diag)
1442 if (cs%id_Sadv > 0)
call post_data(cs%id_Sadv, sadv_flx, cs%diag)
1443 if (cs%use_int_tides)
then 1444 if (cs%id_cg1 > 0)
call post_data(cs%id_cg1, cn(:,:,1),cs%diag)
1446 if (cs%id_cn(m) > 0)
call post_data(cs%id_cn(m),cn(:,:,m),cs%diag)
1451 if (cs%id_Kd_z > 0)
then 1452 num_z_diags = num_z_diags + 1
1453 z_ids(num_z_diags) = cs%id_Kd_z ; z_ptrs(num_z_diags)%p => kd_int
1455 if (cs%id_Tdif_z > 0)
then 1456 num_z_diags = num_z_diags + 1
1457 z_ids(num_z_diags) = cs%id_Tdif_z ; z_ptrs(num_z_diags)%p => tdif_flx
1459 if (cs%id_Tadv_z > 0)
then 1460 num_z_diags = num_z_diags + 1
1461 z_ids(num_z_diags) = cs%id_Tadv_z ; z_ptrs(num_z_diags)%p => tadv_flx
1463 if (cs%id_Sdif_z > 0)
then 1464 num_z_diags = num_z_diags + 1
1465 z_ids(num_z_diags) = cs%id_Sdif_z ; z_ptrs(num_z_diags)%p => sdif_flx
1467 if (cs%id_Sadv_z > 0)
then 1468 num_z_diags = num_z_diags + 1
1469 z_ids(num_z_diags) = cs%id_Sadv_z ; z_ptrs(num_z_diags)%p => sadv_flx
1472 if (num_z_diags > 0) &
1473 call calc_zint_diags(h, z_ptrs, z_ids, num_z_diags, g, gv, cs%diag_to_Z_CSp)
1475 if (cs%debugConservation)
call mom_state_stats(
'leaving diabatic', u, v, h, tv%T, tv%S, g)
1483 evap_CFL_limit, minimum_forcing_depth)
1486 type(
opacity_cs),
pointer,
optional,
intent( out) :: opacity_CSp
1487 type(
optics_type),
pointer,
optional,
intent( out) :: optics_CSp
1488 real,
optional,
intent( out) :: evap_CFL_limit
1489 real,
optional,
intent( out) :: minimum_forcing_depth
1492 if (
present(opacity_csp)) opacity_csp => cs%opacity_CSp
1493 if (
present(optics_csp)) optics_csp => cs%optics
1496 if (
present(evap_cfl_limit)) evap_cfl_limit = cs%evap_CFL_limit
1497 if (
present(minimum_forcing_depth)) minimum_forcing_depth = cs%minimum_forcing_depth
1502 subroutine adiabatic(h, tv, fluxes, dt, G, GV, CS)
1504 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(inout) :: h
1506 type(
forcing),
intent(inout) :: fluxes
1507 real,
intent(in) :: dt
1511 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) :: zeros
1515 call call_tracer_column_fns(h, h, zeros, zeros, fluxes, zeros(:,:,1), dt, g, gv, tv, &
1516 cs%optics, cs%tracer_flow_CSp, cs%debug)
1528 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h
1529 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: temp_old
1530 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: saln_old
1531 real,
intent(in) :: dt
1534 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) :: work_3d
1535 real,
dimension(SZI_(G),SZJ_(G)) :: work_2d
1537 integer :: i, j, k, is, ie, js, je, nz
1539 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
1541 work_3d(:,:,:) = 0.0
1546 do k=1,nz ;
do j=js,je ;
do i=is,ie
1547 work_3d(i,j,k) = (tv%T(i,j,k)-temp_old(i,j,k))*idt
1548 enddo ;
enddo ;
enddo 1549 if(cs%id_diabatic_diff_temp_tend > 0)
then 1550 call post_data(cs%id_diabatic_diff_temp_tend, work_3d, cs%diag)
1554 if(cs%id_diabatic_diff_heat_tend > 0 .or. cs%id_diabatic_diff_heat_tend_2d > 0)
then 1555 do k=1,nz ;
do j=js,je ;
do i=is,ie
1556 work_3d(i,j,k) = h(i,j,k) * gv%H_to_kg_m2 * tv%C_p * work_3d(i,j,k)
1557 enddo ;
enddo ;
enddo 1558 if(cs%id_diabatic_diff_heat_tend > 0)
then 1559 call post_data(cs%id_diabatic_diff_heat_tend, work_3d, cs%diag)
1561 if(cs%id_diabatic_diff_heat_tend_2d > 0)
then 1562 do j=js,je ;
do i=is,ie
1565 work_2d(i,j) = work_2d(i,j) + work_3d(i,j,k)
1568 call post_data(cs%id_diabatic_diff_heat_tend_2d, work_2d, cs%diag)
1573 do k=1,nz ;
do j=js,je ;
do i=is,ie
1574 work_3d(i,j,k) = (tv%S(i,j,k)-saln_old(i,j,k))*idt
1575 enddo ;
enddo ;
enddo 1576 if(cs%id_diabatic_diff_saln_tend > 0)
then 1577 call post_data(cs%id_diabatic_diff_saln_tend, work_3d, cs%diag)
1581 if(cs%id_diabatic_diff_salt_tend > 0 .or. cs%id_diabatic_diff_salt_tend_2d > 0)
then 1582 do k=1,nz ;
do j=js,je ;
do i=is,ie
1583 work_3d(i,j,k) = h(i,j,k) * gv%H_to_kg_m2 * cs%ppt2mks * work_3d(i,j,k)
1584 enddo ;
enddo ;
enddo 1585 if(cs%id_diabatic_diff_salt_tend > 0)
then 1586 call post_data(cs%id_diabatic_diff_salt_tend, work_3d, cs%diag)
1588 if(cs%id_diabatic_diff_salt_tend_2d > 0)
then 1589 do j=js,je ;
do i=is,ie
1592 work_2d(i,j) = work_2d(i,j) + work_3d(i,j,k)
1595 call post_data(cs%id_diabatic_diff_salt_tend_2d, work_2d, cs%diag)
1611 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h
1612 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: temp_old
1613 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: saln_old
1614 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h_old
1615 real,
intent(in) :: dt
1618 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) :: work_3d
1619 real,
dimension(SZI_(G),SZJ_(G)) :: work_2d
1621 integer :: i, j, k, is, ie, js, je, nz
1623 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
1625 work_3d(:,:,:) = 0.0
1629 if(cs%id_boundary_forcing_temp_tend > 0)
then 1630 do k=1,nz ;
do j=js,je ;
do i=is,ie
1631 work_3d(i,j,k) = (tv%T(i,j,k)-temp_old(i,j,k))*idt
1632 enddo ;
enddo ;
enddo 1633 call post_data(cs%id_boundary_forcing_temp_tend, work_3d, cs%diag)
1637 if(cs%id_boundary_forcing_heat_tend > 0 .or. cs%id_boundary_forcing_heat_tend_2d > 0)
then 1638 do k=1,nz ;
do j=js,je ;
do i=is,ie
1639 work_3d(i,j,k) = gv%H_to_kg_m2 * tv%C_p * idt * (h(i,j,k) * tv%T(i,j,k) - h_old(i,j,k) * temp_old(i,j,k))
1640 enddo ;
enddo ;
enddo 1641 if(cs%id_boundary_forcing_heat_tend > 0)
then 1642 call post_data(cs%id_boundary_forcing_heat_tend, work_3d, cs%diag)
1644 if(cs%id_boundary_forcing_heat_tend_2d > 0)
then 1645 do j=js,je ;
do i=is,ie
1648 work_2d(i,j) = work_2d(i,j) + work_3d(i,j,k)
1651 call post_data(cs%id_boundary_forcing_heat_tend_2d, work_2d, cs%diag)
1657 if(cs%id_boundary_forcing_saln_tend > 0)
then 1658 do k=1,nz ;
do j=js,je ;
do i=is,ie
1659 work_3d(i,j,k) = (tv%S(i,j,k)-saln_old(i,j,k))*idt
1660 enddo ;
enddo ;
enddo 1661 call post_data(cs%id_boundary_forcing_saln_tend, work_3d, cs%diag)
1665 if(cs%id_boundary_forcing_salt_tend > 0 .or. cs%id_boundary_forcing_salt_tend_2d > 0)
then 1666 do k=1,nz ;
do j=js,je ;
do i=is,ie
1667 work_3d(i,j,k) = gv%H_to_kg_m2 * cs%ppt2mks * idt * (h(i,j,k) * tv%S(i,j,k) - h_old(i,j,k) * saln_old(i,j,k))
1668 enddo ;
enddo ;
enddo 1669 if(cs%id_boundary_forcing_salt_tend > 0)
then 1670 call post_data(cs%id_boundary_forcing_salt_tend, work_3d, cs%diag)
1672 if(cs%id_boundary_forcing_salt_tend_2d > 0)
then 1673 do j=js,je ;
do i=is,ie
1676 work_2d(i,j) = work_2d(i,j) + work_3d(i,j,k)
1679 call post_data(cs%id_boundary_forcing_salt_tend_2d, work_2d, cs%diag)
1694 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h
1695 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: temp_old
1696 real,
intent(in) :: dt
1697 integer,
intent(in) :: ncall
1700 real,
dimension(SZI_(G),SZJ_(G)) :: work_2d
1702 integer :: i, j, k, is, ie, js, je, nz
1704 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
1710 cs%frazil_heat_diag(:,:,:) = 0.0
1711 cs%frazil_temp_diag(:,:,:) = 0.0
1715 if(cs%id_frazil_temp_tend > 0)
then 1716 do k=1,nz ;
do j=js,je ;
do i=is,ie
1717 cs%frazil_temp_diag(i,j,k) = cs%frazil_temp_diag(i,j,k) + idt * (tv%T(i,j,k)-temp_old(i,j,k))
1718 enddo ;
enddo ;
enddo 1720 call post_data(cs%id_frazil_temp_tend, cs%frazil_temp_diag(:,:,:), cs%diag)
1725 if(cs%id_frazil_heat_tend > 0 .or. cs%id_frazil_heat_tend_2d > 0)
then 1726 do k=1,nz ;
do j=js,je ;
do i=is,ie
1727 cs%frazil_heat_diag(i,j,k) = cs%frazil_heat_diag(i,j,k) + &
1728 gv%H_to_kg_m2 * tv%C_p * h(i,j,k) * idt * (tv%T(i,j,k)-temp_old(i,j,k))
1729 enddo ;
enddo ;
enddo 1730 if(cs%id_frazil_heat_tend > 0 .and. ncall == 2)
then 1731 call post_data(cs%id_frazil_heat_tend, cs%frazil_heat_diag(:,:,:), cs%diag)
1736 if(cs%id_frazil_heat_tend_2d > 0 .and. ncall == 2)
then 1737 do j=js,je ;
do i=is,ie
1740 work_2d(i,j) = work_2d(i,j) + cs%frazil_heat_diag(i,j,k)
1743 call post_data(cs%id_frazil_heat_tend_2d, work_2d, cs%diag)
1755 tracer_flow_CSp, diag_to_Z_CSp)
1756 type(time_type),
intent(in) :: Time
1759 type(
diag_ctrl),
target,
intent(inout) :: diag
1765 #include "version_variable.h" 1766 character(len=40) :: mod =
"MOM_diabatic_driver" 1768 if (
associated(cs))
then 1769 call mom_error(warning,
"adiabatic_driver_init called with an "// &
1770 "associated control structure.")
1772 else ;
allocate(cs) ;
endif 1775 if (
associated(tracer_flow_csp)) cs%tracer_flow_CSp => tracer_flow_csp
1776 if (
associated(diag_to_z_csp)) cs%diag_to_Z_CSp => diag_to_z_csp
1780 "The following parameters are used for diabatic processes.")
1787 ADp, CDp, CS, tracer_flow_CSp, sponge_CSp, &
1788 ALE_sponge_CSp, diag_to_Z_CSp)
1789 type(time_type),
intent(in) :: Time
1793 logical,
intent(in) :: useALEalgorithm
1794 type(
diag_ctrl),
target,
intent(inout) :: diag
1806 logical :: use_temperature, differentialDiffusion
1810 #include "version_variable.h" 1811 character(len=40) :: mod =
"MOM_diabatic_driver" 1812 character(len=48) :: thickness_units
1813 character(len=40) :: var_name
1814 character(len=160) :: var_descript
1815 integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB, nz, nbands, m
1816 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed ; nz = g%ke
1817 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
1819 if (
associated(cs))
then 1820 call mom_error(warning,
"diabatic_driver_init called with an "// &
1821 "associated control structure.")
1828 if (
associated(tracer_flow_csp)) cs%tracer_flow_CSp => tracer_flow_csp
1829 if (
associated(sponge_csp)) cs%sponge_CSp => sponge_csp
1830 if (
associated(ale_sponge_csp)) cs%ALE_sponge_CSp => ale_sponge_csp
1831 if (
associated(diag_to_z_csp)) cs%diag_to_Z_CSp => diag_to_z_csp
1833 cs%useALEalgorithm = usealealgorithm
1834 cs%bulkmixedlayer = (gv%nkml > 0)
1838 "The following parameters are used for diabatic processes.")
1840 call get_param(param_file, mod,
"SPONGE", cs%use_sponge, &
1841 "If true, sponges may be applied anywhere in the domain. \n"//&
1842 "The exact location and properties of those sponges are \n"//&
1843 "specified via calls to initialize_sponge and possibly \n"//&
1844 "set_up_sponge_field.", default=.false.)
1845 call get_param(param_file, mod,
"ENABLE_THERMODYNAMICS", use_temperature, &
1846 "If true, temperature and salinity are used as state \n"//&
1847 "variables.", default=.true.)
1848 call get_param(param_file, mod,
"ENERGETICS_SFC_PBL", cs%use_energetic_PBL, &
1849 "If true, use an implied energetics planetary boundary \n"//&
1850 "layer scheme to determine the diffusivity and viscosity \n"//&
1851 "in the surface boundary layer.", default=.false.)
1852 call get_param(param_file, mod,
"EPBL_IS_ADDITIVE", cs%ePBL_is_additive, &
1853 "If true, the diffusivity from ePBL is added to all\n"//&
1854 "other diffusivities. Otherwise, the larger of kappa-\n"//&
1855 "shear and ePBL diffusivities are used.", default=.true.)
1856 call get_param(param_file, mod,
"DOUBLE_DIFFUSION", differentialdiffusion, &
1857 "If true, apply parameterization of double-diffusion.", &
1861 if (cs%bulkmixedlayer)
then 1862 call get_param(param_file, mod,
"ML_MIX_FIRST", cs%ML_mix_first, &
1863 "The fraction of the mixed layer mixing that is applied \n"//&
1864 "before interior diapycnal mixing. 0 by default.", &
1865 units=
"nondim", default=0.0)
1866 call get_param(param_file, mod,
"NKBL", cs%nkbl, default=2, do_not_log=.true.)
1868 cs%ML_mix_first = 0.0
1870 if (use_temperature)
then 1871 call get_param(param_file, mod,
"DO_GEOTHERMAL", cs%use_geothermal, &
1872 "If true, apply geothermal heating.", default=.false.)
1874 cs%use_geothermal = .false.
1876 call get_param(param_file, mod,
"INTERNAL_TIDES", cs%use_int_tides, &
1877 "If true, use the code that advances a separate set of \n"//&
1878 "equations for the internal tide energy density.", default=.false.)
1880 if (cs%use_int_tides)
then 1882 call get_param(param_file, mod,
"INTERNAL_TIDE_MODES", cs%nMode, &
1883 "The number of distinct internal tide modes \n"//&
1884 "that will be calculated.", default=1, do_not_log=.true.)
1888 call get_param(param_file, mod,
"INTERNAL_TIDE_SOURCE_TEST", cs%int_tide_source_test, &
1889 "If true, apply an arbitrary generation site for internal tide testing", &
1891 if(cs%int_tide_source_test)
then 1892 call get_param(param_file, mod,
"INTERNAL_TIDE_SOURCE_X", cs%int_tide_source_x, &
1893 "X Location of generation site for internal tide", default=1.)
1894 call get_param(param_file, mod,
"INTERNAL_TIDE_SOURCE_Y", cs%int_tide_source_y, &
1895 "Y Location of generation site for internal tide", default=1.)
1896 call get_param(param_file, mod,
"INTERNAL_TIDE_SOURCE_TLEN_DAYS", cs%tlen_days, &
1897 "Time interval from start of experiment for adding wave source", &
1898 units=
"days", default=0)
1899 cs%time_max_source = increment_time(time,0,days=cs%tlen_days)
1902 call get_param(param_file, mod,
"UNIFORM_CG", cs%uniform_cg, &
1903 "If true, set cg = cg_test everywhere for test case", default=.false.)
1904 if(cs%uniform_cg)
then 1905 call get_param(param_file, mod,
"CG_TEST", cs%cg_test, &
1906 "Uniform group velocity of internal tide for test case", default=1.)
1910 call get_param(param_file, mod,
"MASSLESS_MATCH_TARGETS", &
1911 cs%massless_match_targets, &
1912 "If true, the temperature and salinity of massless layers \n"//&
1913 "are kept consistent with their target densities. \n"//&
1914 "Otherwise the properties of massless layers evolve \n"//&
1915 "diffusively to match massive neighboring layers.", &
1918 call get_param(param_file, mod,
"AGGREGATE_FW_FORCING", cs%aggregate_FW_forcing, &
1919 "If true, the net incoming and outgoing fresh water fluxes are combined\n"//&
1920 "and applied as either incoming or outgoing depending on the sign of the net.\n"//&
1921 "If false, the net incoming fresh water flux is added to the model and\n"//&
1922 "thereafter the net outgoing is removed from the updated state."//&
1923 "into the first non-vanished layer for which the column remains stable", &
1926 call get_param(param_file, mod,
"DEBUG", cs%debug, &
1927 "If true, write out verbose debugging data.", default=.false.)
1928 call get_param(param_file, mod,
"DEBUG_CONSERVATION", cs%debugConservation, &
1929 "If true, monitor conservation and extrema.", default=.false.)
1931 call get_param(param_file, mod,
"DEBUG_ENERGY_REQ", cs%debug_energy_req, &
1932 "If true, debug the energy requirements.", default=.false., do_not_log=.true.)
1933 call get_param(param_file, mod,
"MIX_BOUNDARY_TRACERS", cs%mix_boundary_tracers, &
1934 "If true, mix the passive tracers in massless layers at \n"//&
1935 "the bottom into the interior as though a diffusivity of \n"//&
1936 "KD_MIN_TR were operating.", default=.true.)
1938 if (cs%mix_boundary_tracers)
then 1939 call get_param(param_file, mod,
"KD", kd, fail_if_missing=.true.)
1940 call get_param(param_file, mod,
"KD_MIN_TR", cs%Kd_min_tr, &
1941 "A minimal diffusivity that should always be applied to \n"//&
1942 "tracers, especially in massless layers near the bottom. \n"//&
1943 "The default is 0.1*KD.", units=
"m2 s-1", default=0.1*kd)
1944 call get_param(param_file, mod,
"KD_BBL_TR", cs%Kd_BBL_tr, &
1945 "A bottom boundary layer tracer diffusivity that will \n"//&
1946 "allow for explicitly specified bottom fluxes. The \n"//&
1947 "entrainment at the bottom is at least sqrt(Kd_BBL_tr*dt) \n"//&
1948 "over the same distance.", units=
"m2 s-1", default=0.)
1951 call get_param(param_file, mod,
"TRACER_TRIDIAG", cs%tracer_tridiag, &
1952 "If true, use the passive tracer tridiagonal solver for T and S\n", &
1955 call get_param(param_file, mod,
"MINIMUM_FORCING_DEPTH", cs%minimum_forcing_depth, &
1956 "The smallest depth over which forcing can be applied. This\n"//&
1957 "only takes effect when near-surface layers become thin\n"//&
1958 "relative to this scale, in which case the forcing tendencies\n"//&
1959 "scaled down by distributing the forcing over this depth scale.", &
1960 units=
"m", default=0.001)
1961 call get_param(param_file, mod,
"EVAP_CFL_LIMIT", cs%evap_CFL_limit, &
1962 "The largest fraction of a layer than can be lost to forcing\n"//&
1963 "(e.g. evaporation, sea-ice formation) in one time-step. The unused\n"//&
1964 "mass loss is passed down through the column.", &
1965 units=
"nondim", default=0.8)
1969 if (gv%Boussinesq)
then ; thickness_units =
"meter" 1970 else ; thickness_units =
"kilogram meter-2" ;
endif 1972 cs%id_ea = register_diag_field(
'ocean_model',
'ea',diag%axesTL,time, &
1973 'Layer entrainment from above per timestep',
'meter')
1974 cs%id_eb = register_diag_field(
'ocean_model',
'eb',diag%axesTL,time, &
1975 'Layer entrainment from below per timestep',
'meter')
1976 cs%id_dudt_dia = register_diag_field(
'ocean_model',
'dudt_dia',diag%axesCuL,time, &
1977 'Zonal Acceleration from Diapycnal Mixing',
'meter second-2')
1978 cs%id_dvdt_dia = register_diag_field(
'ocean_model',
'dvdt_dia',diag%axesCvL,time, &
1979 'Meridional Acceleration from Diapycnal Mixing',
'meter second-2')
1980 cs%id_wd = register_diag_field(
'ocean_model',
'wd',diag%axesTi,time, &
1981 'Diapycnal Velocity',
'meter second-1')
1982 if (cs%use_int_tides)
then 1983 cs%id_cg1 = register_diag_field(
'ocean_model',
'cn1', diag%axesT1, &
1984 time,
'First baroclinic mode (eigen) speed',
'm s-1')
1985 allocate(cs%id_cn(cs%nMode)) ; cs%id_cn(:) = -1
1987 write(var_name,
'("cn_mode",i1)') m
1988 write(var_descript,
'("Baroclinic (eigen) speed of mode ",i1)') m
1989 cs%id_cn(m) = register_diag_field(
'ocean_model',var_name, diag%axesT1, &
1990 time, var_descript,
'm s-1')
1991 call mom_mesg(
"Registering "//trim(var_name)//
", Described as: "//var_descript, 5)
1995 cs%id_Tdif = register_diag_field(
'ocean_model',
"Tflx_dia_diff",diag%axesTi, &
1996 time,
"Diffusive diapycnal temperature flux across interfaces", &
1997 "degC meter second-1")
1998 cs%id_Tadv = register_diag_field(
'ocean_model',
"Tflx_dia_adv",diag%axesTi, &
1999 time,
"Advective diapycnal temperature flux across interfaces", &
2000 "degC meter second-1")
2001 cs%id_Sdif = register_diag_field(
'ocean_model',
"Sflx_dia_diff",diag%axesTi, &
2002 time,
"Diffusive diapycnal salnity flux across interfaces", &
2003 "PSU meter second-1")
2004 cs%id_Sadv = register_diag_field(
'ocean_model',
"Sflx_dia_adv",diag%axesTi, &
2005 time,
"Advective diapycnal salnity flux across interfaces", &
2006 "PSU meter second-1")
2007 cs%id_MLD_003 = register_diag_field(
'ocean_model',
'MLD_003',diag%axesT1,time, &
2008 'Mixed layer depth (delta rho = 0.03)',
'meter', cmor_field_name=
'mlotst', &
2009 cmor_long_name=
'Ocean Mixed Layer Thickness Defined by Sigma T', cmor_units=
'm', &
2010 cmor_standard_name=
'ocean_mixed_layer_thickness_defined_by_sigma_t')
2011 cs%id_mlotstsq = register_diag_field(
'ocean_model',
'mlotstsq',diag%axesT1,time, &
2012 long_name=
'Square of Ocean Mixed Layer Thickness Defined by Sigma T', &
2013 standard_name=
'square_of_ocean_mixed_layer_thickness_defined_by_sigma_t',units=
'm2')
2014 cs%id_MLD_0125 = register_diag_field(
'ocean_model',
'MLD_0125',diag%axesT1,time, &
2015 'Mixed layer depth (delta rho = 0.125)',
'meter')
2016 cs%id_subMLN2 = register_diag_field(
'ocean_model',
'subML_N2',diag%axesT1,time, &
2017 'Squared buoyancy frequency below mixed layer',
's-2')
2018 cs%id_MLD_user = register_diag_field(
'ocean_model',
'MLD_user',diag%axesT1,time, &
2019 'Mixed layer depth (used defined)',
'meter')
2020 call get_param(param_file, mod,
"DIAG_MLD_DENSITY_DIFF", cs%MLDdensityDifference, &
2021 "The density difference used to determine a diagnostic mixed\n"//&
2022 "layer depth, MLD_user, following the definition of Levitus 1982. \n"//&
2023 "The MLD is the depth at which the density is larger than the\n"//&
2024 "surface density by the specified amount.", units=
'kg/m3', default=0.1)
2027 if (
associated(diag_to_z_csp))
then 2028 vd =
var_desc(
"Kd_interface",
"meter2 second-1", &
2029 "Diapycnal diffusivity at interfaces, interpolated to z", z_grid=
'z')
2031 vd =
var_desc(
"Tflx_dia_diff",
"degC meter second-1", &
2032 "Diffusive diapycnal temperature flux across interfaces, interpolated to z", &
2035 vd =
var_desc(
"Tflx_dia_adv",
"degC meter second-1", &
2036 "Advective diapycnal temperature flux across interfaces, interpolated to z",&
2039 vd =
var_desc(
"Sflx_dia_diff",
"PSU meter second-1", &
2040 "Diffusive diapycnal salinity flux across interfaces, interpolated to z",&
2043 vd =
var_desc(
"Sflx_dia_adv",
"PSU meter second-1", &
2044 "Advective diapycnal salinity flux across interfaces, interpolated to z",&
2049 if (cs%id_dudt_dia > 0)
call safe_alloc_ptr(adp%du_dt_dia,isdb,iedb,jsd,jed,nz)
2050 if (cs%id_dvdt_dia > 0)
call safe_alloc_ptr(adp%dv_dt_dia,isd,ied,jsdb,jedb,nz)
2051 if (cs%id_wd > 0)
call safe_alloc_ptr(cdp%diapyc_vel,isd,ied,jsd,jed,nz+1)
2054 cs%id_Kd_interface = register_diag_field(
'ocean_model',
'Kd_interface', diag%axesTi, time, &
2055 'Total diapycnal diffusivity at interfaces',
'meter2 second-1')
2056 if (cs%use_energetic_PBL)
then 2057 cs%id_Kd_ePBL = register_diag_field(
'ocean_model',
'Kd_ePBL', diag%axesTi, time, &
2058 'ePBL diapycnal diffusivity at interfaces',
'meter2 second-1')
2061 cs%id_Kd_heat = register_diag_field(
'ocean_model',
'Kd_heat', diag%axesTi, time, &
2062 'Total diapycnal diffusivity for heat at interfaces',
'meter2 second-1', &
2063 cmor_field_name=
'difvho', cmor_units=
'm2 s-1', &
2064 cmor_standard_name=
'ocean_vertical_heat_diffusivity', &
2065 cmor_long_name=
'Ocean vertical heat diffusivity')
2066 cs%id_Kd_salt = register_diag_field(
'ocean_model',
'Kd_salt', diag%axesTi, time, &
2067 'Total diapycnal diffusivity for salt at interfaces',
'meter2 second-1', &
2068 cmor_field_name=
'difvso', cmor_units=
'm2 s-1', &
2069 cmor_standard_name=
'ocean_vertical_salt_diffusivity', &
2070 cmor_long_name=
'Ocean vertical salt diffusivity')
2074 cs%useKPP = kpp_init(param_file, g, diag, time, cs%KPP_CSp, passive=cs%KPPisPassive)
2076 allocate( cs%KPP_NLTheat(isd:ied,jsd:jed,nz+1) ) ; cs%KPP_NLTheat(:,:,:) = 0.
2077 allocate( cs%KPP_NLTscalar(isd:ied,jsd:jed,nz+1) ) ; cs%KPP_NLTscalar(:,:,:) = 0.
2080 allocate( cs%KPP_buoy_flux(isd:ied,jsd:jed,nz+1) ) ; cs%KPP_buoy_flux(:,:,:) = 0.
2081 allocate( cs%KPP_temp_flux(isd:ied,jsd:jed) ) ; cs%KPP_temp_flux(:,:) = 0.
2082 allocate( cs%KPP_salt_flux(isd:ied,jsd:jed) ) ; cs%KPP_salt_flux(:,:) = 0.
2085 call get_param(param_file, mod,
"SALT_REJECT_BELOW_ML", cs%salt_reject_below_ML, &
2086 "If true, place salt from brine rejection below the mixed layer,\n"// &
2087 "into the first non-vanished layer for which the column remains stable", &
2090 if (cs%salt_reject_below_ML)
then 2091 cs%id_brine_lay = register_diag_field(
'ocean_model',
'brine_layer',diag%axesT1,time, &
2092 'Brine insertion layer',
'none')
2098 if (cs%useALEalgorithm)
then 2099 cs%id_diabatic_diff_temp_tend = register_diag_field(
'ocean_model', &
2100 'diabatic_diff_temp_tendency', diag%axesTL, time, &
2101 'Diabatic diffusion temperature tendency',
'Degree C per second')
2102 if (cs%id_diabatic_diff_temp_tend > 0)
then 2103 cs%diabatic_diff_tendency_diag = .true.
2106 cs%id_diabatic_diff_saln_tend = register_diag_field(
'ocean_model',&
2107 'diabatic_diff_saln_tendency', diag%axesTL, time, &
2108 'Diabatic diffusion salinity tendency',
'PPT per second')
2109 if (cs%id_diabatic_diff_saln_tend > 0)
then 2110 cs%diabatic_diff_tendency_diag = .true.
2113 cs%id_diabatic_diff_heat_tend = register_diag_field(
'ocean_model', &
2114 'diabatic_heat_tendency', diag%axesTL, time, &
2115 'Diabatic diffusion heat tendency', &
2116 'Watts/m2',cmor_field_name=
'opottempdiff', cmor_units=
'W m-2', &
2117 cmor_standard_name= &
2118 'tendency_of_sea_water_potential_temperature_expressed_as_heat_content_due_to_parameterized_dianeutral_mixing',&
2120 'Tendency of sea water potential temperature expressed as heat content due to parameterized dianeutral mixing',&
2122 if (cs%id_diabatic_diff_heat_tend > 0)
then 2123 cs%diabatic_diff_tendency_diag = .true.
2126 cs%id_diabatic_diff_salt_tend = register_diag_field(
'ocean_model', &
2127 'diabatic_salt_tendency', diag%axesTL, time, &
2128 'Diabatic diffusion of salt tendency', &
2129 'kg/(m2 * s)',cmor_field_name=
'osaltdiff', cmor_units=
'kg m-2 s-1', &
2130 cmor_standard_name= &
2131 'tendency_of_sea_water_salinity_expressed_as_salt_content_due_to_parameterized_dianeutral_mixing', &
2133 'Tendency of sea water salinity expressed as salt content due to parameterized dianeutral mixing', &
2135 if (cs%id_diabatic_diff_salt_tend > 0)
then 2136 cs%diabatic_diff_tendency_diag = .true.
2140 cs%id_diabatic_diff_heat_tend_2d = register_diag_field(
'ocean_model', &
2141 'diabatic_heat_tendency_2d', diag%axesT1, time, &
2142 'Depth integrated diabatic diffusion heat tendency', &
2143 'Watts/m2',cmor_field_name=
'opottempdiff_2d', cmor_units=
'W m-2', &
2144 cmor_standard_name= &
2145 'tendency_of_sea_water_potential_temperature_expressed_as_heat_content_due_to_parameterized_dianeutral_mixing_depth_integrated',&
2147 'Tendency of sea water potential temperature expressed as heat content due to parameterized dianeutral mixing depth integrated')
2148 if (cs%id_diabatic_diff_heat_tend_2d > 0)
then 2149 cs%diabatic_diff_tendency_diag = .true.
2153 cs%id_diabatic_diff_salt_tend_2d = register_diag_field(
'ocean_model', &
2154 'diabatic_salt_tendency_2d', diag%axesT1, time, &
2155 'Depth integrated diabatic diffusion salt tendency', &
2156 'kg/(m2 * s)',cmor_field_name=
'osaltdiff_2d', cmor_units=
'kg m-2 s-1', &
2157 cmor_standard_name= &
2158 'tendency_of_sea_water_salinity_expressed_as_salt_content_due_to_parameterized_dianeutral_mixing_depth_integrated',&
2160 'Tendency of sea water salinity expressed as salt content due to parameterized dianeutral mixing depth integrated')
2161 if (cs%id_diabatic_diff_salt_tend_2d > 0)
then 2162 cs%diabatic_diff_tendency_diag = .true.
2167 cs%id_boundary_forcing_temp_tend = register_diag_field(
'ocean_model',&
2168 'boundary_forcing_temp_tendency', diag%axesTL, time, &
2169 'Boundary forcing temperature tendency',
'Degree C per second')
2170 if (cs%id_boundary_forcing_temp_tend > 0)
then 2171 cs%boundary_forcing_tendency_diag = .true.
2174 cs%id_boundary_forcing_saln_tend = register_diag_field(
'ocean_model',&
2175 'boundary_forcing_saln_tendency', diag%axesTL, time, &
2176 'Boundary forcing saln tendency',
'PPT per second')
2177 if (cs%id_boundary_forcing_saln_tend > 0)
then 2178 cs%boundary_forcing_tendency_diag = .true.
2181 cs%id_boundary_forcing_heat_tend = register_diag_field(
'ocean_model',&
2182 'boundary_forcing_heat_tendency', diag%axesTL, time, &
2183 'Boundary forcing heat tendency',
'Watts/m2')
2184 if (cs%id_boundary_forcing_heat_tend > 0)
then 2185 cs%boundary_forcing_tendency_diag = .true.
2188 cs%id_boundary_forcing_salt_tend = register_diag_field(
'ocean_model',&
2189 'boundary_forcing_salt_tendency', diag%axesTL, time, &
2190 'Boundary forcing salt tendency',
'kg m-2 s-1')
2191 if (cs%id_boundary_forcing_salt_tend > 0)
then 2192 cs%boundary_forcing_tendency_diag = .true.
2196 cs%id_boundary_forcing_heat_tend_2d = register_diag_field(
'ocean_model',&
2197 'boundary_forcing_heat_tendency_2d', diag%axesT1, time, &
2198 'Depth integrated boundary forcing of ocean heat',
'Watts/m2')
2199 if (cs%id_boundary_forcing_heat_tend_2d > 0)
then 2200 cs%boundary_forcing_tendency_diag = .true.
2204 cs%id_boundary_forcing_salt_tend_2d = register_diag_field(
'ocean_model',&
2205 'boundary_forcing_salt_tendency_2d', diag%axesT1, time, &
2206 'Depth integrated boundary forcing of ocean salt',
'kg m-2 s-1')
2207 if (cs%id_boundary_forcing_salt_tend_2d > 0)
then 2208 cs%boundary_forcing_tendency_diag = .true.
2215 cs%id_frazil_temp_tend = register_diag_field(
'ocean_model',&
2216 'frazil_temp_tendency', diag%axesTL, time, &
2217 'Temperature tendency due to frazil formation',
'Degree C per second')
2218 if (cs%id_frazil_temp_tend > 0)
then 2219 cs%frazil_tendency_diag = .true.
2223 cs%id_frazil_heat_tend = register_diag_field(
'ocean_model',&
2224 'frazil_heat_tendency', diag%axesTL, time, &
2225 'Heat tendency due to frazil formation',
'Watts/m2')
2226 if (cs%id_frazil_heat_tend > 0)
then 2227 cs%frazil_tendency_diag = .true.
2231 cs%id_frazil_heat_tend_2d = register_diag_field(
'ocean_model',&
2232 'frazil_heat_tendency_2d', diag%axesT1, time, &
2233 'Depth integrated heat tendency due to frazil formation',
'Watts/m2')
2234 if (cs%id_frazil_heat_tend_2d > 0)
then 2235 cs%frazil_tendency_diag = .true.
2238 if (cs%frazil_tendency_diag)
then 2239 allocate(cs%frazil_temp_diag(isd:ied,jsd:jed,nz) ) ; cs%frazil_temp_diag(:,:,:) = 0.
2240 allocate(cs%frazil_heat_diag(isd:ied,jsd:jed,nz) ) ; cs%frazil_heat_diag(:,:,:) = 0.
2246 cs%useConvection = diffconvection_init(param_file, g, diag, time, cs%Conv_CSp)
2248 call entrain_diffusive_init(time, g, gv, param_file, diag, cs%entrain_diffusive_CSp)
2251 if (cs%use_geothermal) &
2255 if (cs%use_int_tides)
then 2256 call int_tide_input_init(time, g, gv, param_file, diag, cs%int_tide_input_CSp, &
2262 call set_diffusivity_init(time, g, gv, param_file, diag, cs%set_diff_CSp, diag_to_z_csp, cs%int_tide_CSp)
2266 id_clock_entrain = cpu_clock_id(
'(Ocean diabatic entrain)', grain=clock_module)
2267 if (cs%bulkmixedlayer) &
2269 id_clock_remap = cpu_clock_id(
'(Ocean vert remap)', grain=clock_module)
2270 if (cs%use_geothermal) &
2273 id_clock_kpp = cpu_clock_id(
'(Ocean KPP)', grain=clock_module)
2274 id_clock_tracers = cpu_clock_id(
'(Ocean tracer_columns)', grain=clock_module_driver+5)
2275 if (cs%use_sponge) &
2277 id_clock_tridiag = cpu_clock_id(
'(Ocean diabatic tridiag)', grain=clock_routine)
2278 id_clock_pass = cpu_clock_id(
'(Ocean diabatic message passing)', grain=clock_routine)
2283 call diabatic_aux_init(time, g, gv, param_file, diag, cs%diabatic_aux_CSp, &
2284 cs%useALEalgorithm, cs%use_energetic_PBL)
2287 if (cs%bulkmixedlayer) &
2289 if (cs%use_energetic_PBL) &
2290 call energetic_pbl_init(time, g, gv, param_file, diag, cs%energetic_PBL_CSp)
2294 if (cs%debug_energy_req) &
2295 call diapyc_energy_req_init(time, g, param_file, diag, cs%diapyc_en_rec_CSp)
2298 if (use_temperature)
then 2299 call get_param(param_file, mod,
"PEN_SW_NBANDS", nbands, default=1)
2300 if (nbands > 0)
then 2302 call opacity_init(time, g, param_file, diag, cs%tracer_flow_CSp, cs%opacity_CSp, cs%optics)
2306 if (
ASSOCIATED(cs%optics)) cs%nsw = cs%optics%nbands
2316 if (.not.
associated(cs))
return 2318 call diabatic_aux_end(cs%diabatic_aux_CSp)
2321 call set_diffusivity_end(cs%set_diff_CSp)
2323 deallocate( cs%KPP_buoy_flux )
2324 deallocate( cs%KPP_temp_flux )
2325 deallocate( cs%KPP_salt_flux )
2328 deallocate( cs%KPP_NLTheat )
2329 deallocate( cs%KPP_NLTscalar )
2330 call kpp_end(cs%KPP_CSp)
2333 if (cs%use_energetic_PBL) &
2334 call energetic_pbl_end(cs%energetic_PBL_CSp)
2335 if (cs%debug_energy_req) &
2336 call diapyc_energy_req_end(cs%diapyc_en_rec_CSp)
2338 if (
associated(cs%optics))
then 2340 deallocate(cs%optics)
2342 if (
associated(cs))
deallocate(cs)
subroutine, public differential_diffuse_t_s(h, tv, visc, dt, G, GV)
subroutine, public geothermal(h, tv, dt, ea, eb, G, GV, CS)
This subroutine applies geothermal heating, including the movement of water between isopycnal layers ...
subroutine, public set_diffusivity_end(CS)
subroutine, public opacity_init(Time, G, param_file, diag, tracer_flow, CS, optics)
subroutine, public diabatic_aux_init(Time, G, GV, param_file, diag, CS, useALEalgorithm, use_ePBL)
subroutine, public diapyc_energy_req_init(Time, G, param_file, diag, CS)
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 opacity_end(CS, optics)
subroutine, public apply_ale_sponge(h, dt, G, CS)
This subroutine applies damping to the layers thicknesses, temp, salt and a variety of tracers for ev...
This module implements boundary forcing for MOM6.
Interface to CVMix interior shear schemes.
subroutine, public insert_brine(h, tv, G, GV, fluxes, nkmb, CS, dt, id_brine_lay)
logical function, public diffconvection_init(paramFile, G, diag, Time, CS)
subroutine, public set_opacity(optics, fluxes, G, GV, CS)
subroutine, public internal_tides_init(Time, G, GV, param_file, diag, CS)
integer, parameter, public to_all
Ocean grid type. See mom_grid for details.
subroutine, public adiabatic_driver_init(Time, G, param_file, diag, CS, tracer_flow_CSp, diag_to_Z_CSp)
A simplified version of diabatic_driver_init that will allow tracer column functions to be called wit...
subroutine, public diapyc_energy_req_end(CS)
subroutine, public diffconvection_calculate(CS, G, GV, h, Temp, Salt, EOS, Kd_int)
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...
subroutine, public energetic_pbl_end(CS)
integer id_clock_differential_diff
Calculates density of sea water from T, S and P.
Calculates the freezing point of sea water from T, S and P.
subroutine, public bulkmixedlayer_init(Time, G, GV, param_file, diag, CS)
subroutine, public mom_thermovar_chksum(mesg, tv, G)
MOM_thermovar_chksum does diagnostic checksums on various elements of a thermo_var_ptrs type for debu...
Provides the ocean grid type.
subroutine, public do_group_pass(group, MOM_dom)
subroutine, public absorbremainingsw(G, GV, h, opacity_band, nsw, j, dt, H_limit_fluxes, adjustAbsorptionProfile, absorbAllSW, T, Pen_SW_bnd, eps, ksort, htot, Ttot, TKE, dSV_dT)
Apply shortwave heating below surface boundary layer.
subroutine, public entrainment_diffusive(u, v, h, tv, fluxes, dt, G, GV, CS, ea, eb, kb_out, Kd_Lay, Kd_int)
This subroutine calculates ea and eb, the rates at which a layer entrains from the layers above and b...
The vertvisc_type structure contains vertical viscosities, drag coefficients, and related fields...
subroutine, public call_tracer_column_fns(h_old, h_new, ea, eb, fluxes, Hml, dt, G, GV, tv, optics, CS, debug, evap_CFL_limit, minimum_forcing_depth)
This subroutine calls all registered tracer column physics subroutines.
subroutine, public mom_forcing_chksum(mesg, fluxes, G, haloshift)
Write out chksums for basic state variables.
This routine drives the diabatic/dianeutral physics for MOM.
subroutine, public diffconvection_end(CS)
subroutine, public energetic_pbl(h_3d, u_3d, v_3d, tv, fluxes, dt, Kd_int, G, GV, CS, dSV_dT, dSV_dS, TKE_forced, Buoy_Flux, dt_diag, last_call, dT_expected, dS_expected)
This subroutine determines the diffusivities from the integrated energetics mixed layer model...
Routines for calculating baroclinic wave speeds.
subroutine, public calculate_specific_vol_derivs(T, S, pressure, dSV_dT, dSV_dS, start, npts, EOS)
Calls the appropriate subroutine to calculate specific volume derivatives for an array.
subroutine, public calltree_leave(mesg)
Writes a message about leaving a subroutine if call tree reporting is active.
subroutine, public internal_tides_end(CS)
This module contains I/O framework code.
Control structure for containing KPP parameters/data.
The accel_diag_ptrs structure contains pointers to arrays with accelerations, which can later be used...
integer id_clock_set_diffusivity
subroutine, public set_diffusivity(u, v, h, u_h, v_h, tv, fluxes, optics, visc, dt, G, GV, CS, Kd, Kd_int)
This module contains the routines used to apply sponge layers when using the ALE mode. Applying sponges requires the following: (1) initialize_ALE_sponge (2) set_up_ALE_sponge_field (tracers) and set_up_ALE_sponge_vel_field (vel) (3) apply_ALE_sponge (4) init_ALE_sponge_diags (not being used for now) (5) ALE_sponge_end (not being used for now)
SPONGE control structure.
subroutine, public applyboundaryfluxesinout(CS, G, GV, dt, fluxes, optics, h, tv, aggregate_FW_forcing, evap_CFL_limit, minimum_forcing_depth, cTKE, dSV_dT, dSV_dS, SkinBuoyFlux)
Update the thickness, temperature, and salinity due to thermodynamic boundary forcing (contained in f...
subroutine, public mom_state_stats(mesg, u, v, h, Temp, Salt, G, allowChange, permitDiminishing)
subroutine, public kpp_calculate(CS, G, GV, h, Temp, Salt, u, v, EOS, uStar, buoyFlux, Kt, Ks, Kv, nonLocalTransHeat, nonLocalTransScalar)
KPP vertical diffusivity/viscosity and non-local tracer transport.
subroutine, public extract_diabatic_member(CS, opacity_CSp, optics_CSp, evap_CFL_limit, minimum_forcing_depth)
Returns pointers or values of members within the diabatic_CS type. For extensibility, each returned argument is an optional argument.
subroutine, public set_diffusivity_init(Time, G, GV, param_file, diag, CS, diag_to_Z_CSp, int_tide_CSp)
subroutine diagnose_diabatic_diff_tendency(tv, h, temp_old, saln_old, dt, G, GV, CS)
This routine diagnoses tendencies from application of diabatic diffusion using ALE algorithm...
subroutine, public propagate_int_tide(h, tv, cn, TKE_itidal_input, vel_btTide, Nb, dt, G, GV, CS)
This subroutine calls other subroutines in this file that are needed to refract, propagate, and dissipate energy density of the internal tide.
subroutine, public geothermal_end(CS)
subroutine, public calltree_waypoint(mesg, n)
Writes a message about reaching a milestone if call tree reporting is active.
subroutine diagnose_boundary_forcing_tendency(tv, h, temp_old, saln_old, h_old, dt, G, GV, CS)
This routine diagnoses tendencies from application of boundary fluxes. These impacts are generally 3d...
integer id_clock_geothermal
Control structure for diabatic_aux.
subroutine, public entrain_diffusive_end(CS)
The cont_diag_ptrs structure contains pointers to arrays with transports, which can later be used for...
This module contains routines that implement physical fluxes of tracers (e.g. due to surface fluxes o...
subroutine, public regularize_layers_init(Time, G, param_file, diag, CS)
subroutine, public diabatic_driver_end(CS)
Routine to close the diabatic driver module.
subroutine, public find_uv_at_h(u, v, h, u_h, v_h, G, GV, ea, eb)
subroutine, public diapyc_energy_req_calc(h_in, T_in, S_in, Kd, energy_Kd, dt, tv, G, GV, may_print, CS)
This subroutine uses a substantially refactored tridiagonal equation for diapycnal mixing of temperat...
subroutine, public kpp_end(CS)
Clear pointers, deallocate memory.
subroutine, public adiabatic(h, tv, fluxes, dt, G, GV, CS)
Routine called for adiabatic physics.
subroutine, public calculatebuoyancyflux2d(G, GV, fluxes, optics, h, Temp, Salt, tv, buoyancyFlux, netHeatMinusSW, netSalt, skip_diags)
Calculates surface buoyancy flux by adding up the heat, FW and salt fluxes, for 2d arrays...
Structure that contains pointers to the boundary forcing used to drive the liquid ocean simulated by ...
subroutine, public geothermal_init(Time, G, param_file, diag, CS)
subroutine, public diapyc_energy_req_test(h_3d, dt, tv, G, GV, CS, Kd_int)
subroutine, public mom_mesg(message, verb, all_print)
logical function, public kpp_init(paramFile, G, diag, Time, CS, passive)
Initialize the CVmix KPP module and set up diagnostics Returns True if KPP is to be used...
Provides subroutines for quantities specific to the equation of state.
subroutine, public kpp_nonlocaltransport_temp(CS, G, GV, h, nonLocalTrans, surfFlux, dt, scalar, C_p)
Apply KPP non-local transport of surface fluxes for temperature.
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.
subroutine, public tracer_vertdiff(h_old, ea, eb, dt, tr, G, GV, sfc_flux, btm_flux, btm_reservoir, sink_rate, convert_flux_in)
This subroutine solves a tridiagonal equation for the final tracer concentrations after the dual-entr...
subroutine, public wave_speeds(h, tv, G, GV, nmodes, cn, CS, full_halos)
Calculates the wave speeds for the first few barolinic modes.
subroutine, public entrain_diffusive_init(Time, G, GV, param_file, diag, CS)
integer id_clock_mixedlayer
subroutine, public regularize_layers(h, tv, dt, ea, eb, G, GV, CS)
This subroutine partially steps the bulk mixed layer model. The following processes are executed...
subroutine, public set_bbl_tke(u, v, h, fluxes, visc, G, GV, CS)
This subroutine calculates several properties related to bottom boundary layer turbulence.
logical function, public cvmix_shear_is_used(param_file)
Reads the parameters "LMD94" and "PP81" and returns state. This function allows other modules to know...
subroutine, public kpp_nonlocaltransport_saln(CS, G, GV, h, nonLocalTrans, surfFlux, dt, scalar)
Apply KPP non-local transport of surface fluxes for salinity. This routine is a useful prototype for ...
subroutine, public diabatic_aux_end(CS)
subroutine, public apply_sponge(h, dt, G, GV, ea, eb, CS, Rcv_ml)
The thermo_var_ptrs structure contains pointers to an assortment of thermodynamic fields that may be ...
Provides the K-Profile Parameterization (KPP) of Large et al., 1994, via CVMix.
integer function, public register_zint_diag(var_desc, CS, day)
subroutine, public tridiagts(G, GV, is, ie, js, je, hold, ea, eb, T, S)
subroutine, public diagnosemldbydensitydifference(id_MLD, h, tv, densityDiff, G, GV, diagPtr, id_N2subML, id_MLDsq)
Diagnose a mixed layer depth (MLD) determined by a given density difference with the surface...
subroutine, public energetic_pbl_get_mld(CS, MLD, G)
Copies the ePBL active mixed layer depth into MLD.
subroutine, public make_frazil(h, tv, G, GV, CS, p_surf)
subroutine, public bulkmixedlayer(h_3d, u_3d, v_3d, tv, fluxes, dt, ea, eb, G, GV, CS, optics, Hml, aggregate_FW_forcing, dt_diag, last_call)
This subroutine partially steps the bulk mixed layer model. The following processes are executed...
subroutine, public adjust_salt(h, tv, G, GV, CS)
subroutine, public mom_error(level, message, all_print)
subroutine, public energetic_pbl_init(Time, G, GV, param_file, diag, CS)
subroutine, public calc_zint_diags(h, in_ptrs, ids, num_diags, G, GV, CS)
logical function, public kappa_shear_is_used(param_file)
subroutine diagnose_frazil_tendency(tv, h, temp_old, dt, G, GV, CS, ncall)
This routine diagnoses tendencies for temperature and heat from frazil formation. This routine is cal...
subroutine, public forcing_singlepointprint(fluxes, G, i, j, mesg)
Write out values of the fluxes arrays at the i,j location. This is a debugging tool.
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.