41 REAL,
PARAMETER,
PUBLIC ::
kwvb=6.28e-5
43 REAL,
PARAMETER,
PUBLIC ::
kwvbeq=6.28e-5/7.
45 REAL,
PARAMETER,
PUBLIC ::
kwvo=6.28e-5
49 REAL,
PARAMETER,
PUBLIC ::
mxasym=0.1
53 REAL,
PARAMETER,
PUBLIC ::
n2min=1.e-8
55 REAL,
PARAMETER,
PUBLIC ::
fcrit2=0.5
63 REAL,
PARAMETER,
PUBLIC ::
taumin=1.e-10
67 REAL,
PARAMETER,
PUBLIC ::
tndmax=500./86400.
69 REAL,
PARAMETER,
PUBLIC ::
umcfac=0.5
78 REAL,
PARAMETER,
PUBLIC ::
pi_gwd=4.0*atan(1.0)
83 SUBROUTINE gw_main_b(pcols, pver, dt, pgwv, effgworo_dev, &
84 & effgwbkg_dev, pint_dev, t_dev, u_dev, u_devb, v_dev, v_devb, &
85 & sgh_dev, pref_dev, pmid_dev, pdel_dev, rpdel_dev, lnpint_dev, zm_dev, &
86 & qvt_dev, rog, mapl_vireps_, rlat_dev)
101 REAL :: effgwbkg_dev(pcols)
103 REAL :: effgworo_dev(pcols)
105 REAL :: pint_dev(pcols, pver+1)
107 REAL :: t_dev(pcols, pver)
109 REAL :: u_dev(pcols, pver)
110 REAL :: u_devb(pcols, pver)
112 REAL :: v_dev(pcols, pver)
113 REAL :: v_devb(pcols, pver)
115 REAL :: sgh_dev(pcols)
117 REAL :: pref_dev(pver+1)
119 REAL :: pmid_dev(pcols, pver)
121 REAL :: pdel_dev(pcols, pver)
123 REAL :: rpdel_dev(pcols, pver)
125 REAL :: lnpint_dev(pcols, pver+1)
127 REAL :: zm_dev(pcols, pver)
129 REAL :: zi_dev(pcols, pver+1)
131 REAL :: qvt_dev(pcols, pver)
133 REAL :: rlat_dev(pcols)
135 REAL :: dudt_gwd_dev(pcols, pver)
136 REAL :: dudt_gwd_devb(pcols, pver)
138 REAL :: dvdt_gwd_dev(pcols, pver)
139 REAL :: dvdt_gwd_devb(pcols, pver)
141 REAL :: dtdt_gwd_dev(pcols, pver)
142 REAL :: dtdt_gwd_devb(pcols, pver)
144 REAL :: dudt_org_dev(pcols, pver)
146 REAL :: dvdt_org_dev(pcols, pver)
148 REAL :: dtdt_org_dev(pcols, pver)
150 REAL :: taugwdx_dev(pcols)
152 REAL :: taugwdy_dev(pcols)
154 REAL :: tauox_dev(pcols, pver+1)
156 REAL :: tauoy_dev(pcols, pver+1)
158 REAL :: feo_dev(pcols, pver+1)
160 REAL :: fepo_dev(pcols, pver+1)
162 REAL :: taubkgx_dev(pcols)
164 REAL :: taubkgy_dev(pcols)
166 REAL :: taubx_dev(pcols, pver+1)
168 REAL :: tauby_dev(pcols, pver+1)
170 REAL :: feb_dev(pcols, pver+1)
172 REAL :: fepb_dev(pcols, pver+1)
174 REAL :: utbsrc_dev(pcols, pver)
176 REAL :: vtbsrc_dev(pcols, pver)
178 REAL :: ttbsrc_dev(pcols, pver)
187 INTEGER :: ktopbg, ktoporo
228 REAL :: alpha(0:pver)
230 REAL :: dback(0:pver)
232 REAL :: c(-pgwv:pgwv)
234 REAL :: att_dev(pcols, pver)
235 REAL :: att_devb(pcols, pver)
240 REAL :: hkl, hkk, tvfac, tv,
rog 252 zi_dev(i, pver+1) = 0.
254 hkl = lnpint_dev(i, k+1) - lnpint_dev(i, k)
255 hkk = 1. - pint_dev(i, k)*hkl*rpdel_dev(i, k)
256 tvfac = 1. + mapl_vireps_*qvt_dev(i, k)
257 tv = att_dev(i, k)*tvfac
258 zm_dev(i, k) = zi_dev(i, k+1) +
rog*tv*hkk
259 zi_dev(i, k) = zi_dev(i, k+1) +
rog*tv*hkl
268 CALL gw_intr_fwd(i, pcols, pver, dt, pgwv, effgworo_dev, &
269 & effgwbkg_dev, pint_dev, att_dev, u_dev, v_dev, sgh_dev, &
270 & pref_dev, pmid_dev, pdel_dev, rpdel_dev, lnpint_dev, &
271 & zm_dev, rlat_dev, dudt_gwd_dev, dvdt_gwd_dev, &
272 & dtdt_gwd_dev, dudt_org_dev, dvdt_org_dev, dtdt_org_dev, &
273 & taugwdx_dev, taugwdy_dev, tauox_dev, tauoy_dev, feo_dev, &
274 & taubkgx_dev, taubkgy_dev, taubx_dev, tauby_dev, feb_dev, &
275 & fepo_dev, fepb_dev, utbsrc_dev, vtbsrc_dev, ttbsrc_dev)
282 CALL gw_intr_fwd(i, pcols, pver, dt, pgwv, effgworo_dev, &
283 & effgwbkg_dev, pint_dev, att_dev, u_dev, v_dev, sgh_dev, &
284 & pref_dev, pmid_dev, pdel_dev, rpdel_dev, lnpint_dev, &
285 & zm_dev, rlat_dev, dudt_gwd_dev, dvdt_gwd_dev, &
286 & dtdt_gwd_dev, dudt_org_dev, dvdt_org_dev, dtdt_org_dev, &
287 & taugwdx_dev, taugwdy_dev, tauox_dev, tauoy_dev, feo_dev, &
288 & taubkgx_dev, taubkgy_dev, taubx_dev, tauby_dev, feb_dev, &
289 & fepo_dev, fepb_dev, utbsrc_dev, vtbsrc_dev, ttbsrc_dev)
299 CALL gw_intr_bwd(i, pcols, pver, dt, pgwv, effgworo_dev, &
300 & effgwbkg_dev, pint_dev, att_dev, u_dev, u_devb&
301 & , v_dev, v_devb, sgh_dev, pref_dev, pmid_dev, pdel_dev, &
302 & rpdel_dev, lnpint_dev, zm_dev, rlat_dev, dudt_gwd_dev, &
303 & dudt_gwd_devb, dvdt_gwd_dev, dvdt_gwd_devb, dtdt_gwd_dev&
304 & , dudt_org_dev, dvdt_org_dev, dtdt_org_dev&
305 & , taugwdx_dev, taugwdy_dev, tauox_dev, tauoy_dev, feo_dev&
306 & , taubkgx_dev, taubkgy_dev, taubx_dev, tauby_dev, feb_dev&
307 & , fepo_dev, fepb_dev, utbsrc_dev, vtbsrc_dev, ttbsrc_dev)
317 CALL gw_intr_bwd(i, pcols, pver, dt, pgwv, effgworo_dev, &
318 & effgwbkg_dev, pint_dev, att_dev, u_dev, u_devb&
319 & , v_dev, v_devb, sgh_dev, pref_dev, pmid_dev, pdel_dev, &
320 & rpdel_dev, lnpint_dev, zm_dev, rlat_dev, dudt_gwd_dev, &
321 & dudt_gwd_devb, dvdt_gwd_dev, dvdt_gwd_devb, dtdt_gwd_dev&
322 & , dudt_org_dev, dvdt_org_dev, dtdt_org_dev&
323 & , taugwdx_dev, taugwdy_dev, tauox_dev, tauoy_dev, feo_dev&
324 & , taubkgx_dev, taubkgy_dev, taubx_dev, tauby_dev, feb_dev&
325 & , fepo_dev, fepb_dev, utbsrc_dev, vtbsrc_dev, ttbsrc_dev)
331 SUBROUTINE gw_intr_fwd(i, pcols, pver, dt, pgwv, effgworo_dev, &
332 & effgwbkg_dev, pint_dev, t_dev, u_dev, v_dev, sgh_dev, pref_dev, &
333 & pmid_dev, pdel_dev, rpdel_dev, lnpint_dev, zm_dev, rlat_dev, &
334 & dudt_gwd_dev, dvdt_gwd_dev, dtdt_gwd_dev, dudt_org_dev, dvdt_org_dev&
335 & , dtdt_org_dev, taugwdx_dev, taugwdy_dev, tauox_dev, tauoy_dev, &
336 & feo_dev, taubkgx_dev, taubkgy_dev, taubx_dev, tauby_dev, feb_dev, &
337 & fepo_dev, fepb_dev, utbsrc_dev, vtbsrc_dev, ttbsrc_dev)
344 INTEGER,
INTENT(IN) :: pcols
346 INTEGER,
INTENT(IN) :: pver
348 REAL,
INTENT(IN) :: dt
350 INTEGER,
INTENT(IN) :: pgwv
352 REAL :: effgwbkg_dev(pcols)
354 REAL :: effgworo_dev(pcols)
356 REAL :: pint_dev(pcols, pver+1)
358 REAL :: t_dev(pcols, pver)
360 REAL :: u_dev(pcols, pver)
362 REAL :: v_dev(pcols, pver)
364 REAL :: sgh_dev(pcols)
366 REAL :: pref_dev(pver+1)
368 REAL :: pmid_dev(pcols, pver)
370 REAL :: pdel_dev(pcols, pver)
372 REAL :: rpdel_dev(pcols, pver)
374 REAL :: lnpint_dev(pcols, pver+1)
376 REAL :: zm_dev(pcols, pver)
378 REAL :: rlat_dev(pcols)
380 REAL :: dudt_gwd_dev(pcols, pver)
382 REAL :: dvdt_gwd_dev(pcols, pver)
384 REAL :: dtdt_gwd_dev(pcols, pver)
386 REAL :: dudt_org_dev(pcols, pver)
388 REAL :: dvdt_org_dev(pcols, pver)
390 REAL :: dtdt_org_dev(pcols, pver)
392 REAL :: taugwdx_dev(pcols)
394 REAL :: taugwdy_dev(pcols)
396 REAL :: tauox_dev(pcols, pver+1)
398 REAL :: tauoy_dev(pcols, pver+1)
400 REAL :: feo_dev(pcols, pver+1)
402 REAL :: fepo_dev(pcols, pver+1)
404 REAL :: taubkgx_dev(pcols)
406 REAL :: taubkgy_dev(pcols)
408 REAL :: taubx_dev(pcols, pver+1)
410 REAL :: tauby_dev(pcols, pver+1)
412 REAL :: feb_dev(pcols, pver+1)
414 REAL :: fepb_dev(pcols, pver+1)
416 REAL :: utbsrc_dev(pcols, pver)
418 REAL :: vtbsrc_dev(pcols, pver)
420 REAL :: ttbsrc_dev(pcols, pver)
423 INTEGER :: i, ii, k, kc
429 INTEGER :: ktopbg, ktoporo
470 REAL :: alpha(0:pver)
472 REAL :: dback(0:pver)
474 REAL :: c(-pgwv:pgwv)
476 REAL :: tau(-pgwv:pgwv, 0:pver)
487 IF (pref_dev(k+1) .LT.
p_src) kbotbg = k
492 CALL gw_prof(i, k, pcols, pver, u_dev, v_dev, t_dev, pmid_dev, &
493 & pint_dev, rhoi, ni, ti, nm)
498 IF (pgwv .GT. 0 .AND.
do_bgnd)
THEN 500 CALL gw_bgnd_fwd(i, pcols, pver, c, u_dev, v_dev, t_dev, pmid_dev&
501 & , pint_dev, pdel_dev, rpdel_dev, lnpint_dev, rlat_dev, &
502 & kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, &
511 & , c, u_dev, v_dev, t_dev, pint_dev, pdel_dev, &
512 & rpdel_dev, lnpint_dev, rlat_dev, rhoi, ni, ti, nm&
513 & , dt, alpha, dback, kldv, kldvmn, ksrc, ksrcmn, &
514 & rdpldv, tau, ubi, ubm, xv, yv, utgw, vtgw, ttgw, &
515 & taubx_dev, tauby_dev, feb_dev, fepb_dev, utosrc, &
516 & vtosrc, ttosrc, tau0x, tau0y, effgwbkg_dev)
519 dudt_gwd_dev(i, k) = utgw(k) + utosrc(k)
520 dvdt_gwd_dev(i, k) = vtgw(k) + vtosrc(k)
529 dudt_gwd_dev(i, k) = 0.
530 dvdt_gwd_dev(i, k) = 0.
540 CALL gw_oro_fwd(i, pcols, pver, pgwv, u_dev, v_dev, t_dev, sgh_dev&
541 & , pmid_dev, pint_dev, pdel_dev, zm_dev, nm, kldv, kldvmn&
542 & , ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, kbotoro, &
546 & , u_dev, v_dev, t_dev, pint_dev, pdel_dev, &
547 & rpdel_dev, lnpint_dev, rlat_dev, rhoi, ni, ti, nm&
548 & , dt, alpha, dback, kldv, kldvmn, ksrc, ksrcmn, &
549 & rdpldv, tau, ubi, ubm, xv, yv, utgw, vtgw, ttgw, &
550 & tauox_dev, tauoy_dev, feo_dev, fepo_dev, utosrc, &
551 & vtosrc, ttosrc, tau0x, tau0y, effgworo_dev)
555 dudt_gwd_dev(i, k) = dudt_gwd_dev(i, k) + utgw(k)
556 dvdt_gwd_dev(i, k) = dvdt_gwd_dev(i, k) + vtgw(k)
565 u_dev(i, k) = u_dev(i, k) + dudt_gwd_dev(i, k)*dt
567 v_dev(i, k) = v_dev(i, k) + dvdt_gwd_dev(i, k)*dt
587 SUBROUTINE gw_intr_bwd(i, pcols, pver, dt, pgwv, effgworo_dev, &
588 & effgwbkg_dev, pint_dev, t_dev, u_dev, u_devb, v_dev, v_devb, sgh_dev&
589 & , pref_dev, pmid_dev, pdel_dev, rpdel_dev, lnpint_dev, zm_dev, &
590 & rlat_dev, dudt_gwd_dev, dudt_gwd_devb, dvdt_gwd_dev, dvdt_gwd_devb, &
591 & dtdt_gwd_dev, dudt_org_dev, dvdt_org_dev, dtdt_org_dev, taugwdx_dev&
592 & , taugwdy_dev, tauox_dev, tauoy_dev, feo_dev, taubkgx_dev, &
593 & taubkgy_dev, taubx_dev, tauby_dev, feb_dev, fepo_dev, fepb_dev, &
594 & utbsrc_dev, vtbsrc_dev, ttbsrc_dev)
596 INTEGER,
INTENT(IN) :: pcols
597 INTEGER,
INTENT(IN) :: pver
598 REAL,
INTENT(IN) :: dt
599 INTEGER,
INTENT(IN) :: pgwv
600 REAL :: effgwbkg_dev(pcols)
601 REAL :: effgworo_dev(pcols)
602 REAL :: pint_dev(pcols, pver+1)
603 REAL :: t_dev(pcols, pver)
604 REAL :: u_dev(pcols, pver)
605 REAL :: u_devb(pcols, pver)
606 REAL :: v_dev(pcols, pver)
607 REAL :: v_devb(pcols, pver)
608 REAL :: sgh_dev(pcols)
609 REAL :: pref_dev(pver+1)
610 REAL :: pmid_dev(pcols, pver)
611 REAL :: pdel_dev(pcols, pver)
612 REAL :: rpdel_dev(pcols, pver)
613 REAL :: lnpint_dev(pcols, pver+1)
614 REAL :: zm_dev(pcols, pver)
615 REAL :: rlat_dev(pcols)
616 REAL :: dudt_gwd_dev(pcols, pver)
617 REAL :: dudt_gwd_devb(pcols, pver)
618 REAL :: dvdt_gwd_dev(pcols, pver)
619 REAL :: dvdt_gwd_devb(pcols, pver)
620 REAL :: dtdt_gwd_dev(pcols, pver)
621 REAL :: dudt_org_dev(pcols, pver)
622 REAL :: dvdt_org_dev(pcols, pver)
623 REAL :: dtdt_org_dev(pcols, pver)
624 REAL :: taugwdx_dev(pcols)
625 REAL :: taugwdy_dev(pcols)
626 REAL :: tauox_dev(pcols, pver+1)
627 REAL :: tauoy_dev(pcols, pver+1)
628 REAL :: feo_dev(pcols, pver+1)
629 REAL :: fepo_dev(pcols, pver+1)
630 REAL :: taubkgx_dev(pcols)
631 REAL :: taubkgy_dev(pcols)
632 REAL :: taubx_dev(pcols, pver+1)
633 REAL :: tauby_dev(pcols, pver+1)
634 REAL :: feb_dev(pcols, pver+1)
635 REAL :: fepb_dev(pcols, pver+1)
636 REAL :: utbsrc_dev(pcols, pver)
637 REAL :: vtbsrc_dev(pcols, pver)
638 REAL :: ttbsrc_dev(pcols, pver)
639 INTEGER :: i, ii, k, kc
642 INTEGER :: ktopbg, ktoporo
668 REAL :: utosrcb(pver)
670 REAL :: vtosrcb(pver)
672 REAL :: alpha(0:pver)
673 REAL :: dback(0:pver)
674 REAL :: c(-pgwv:pgwv)
675 REAL :: tau(-pgwv:pgwv, 0:pver)
676 REAL :: taub(-pgwv:pgwv, 0:pver)
692 dvdt_gwd_devb(i, k) = dvdt_gwd_devb(i, k) + dt*v_devb(i, k)
694 dudt_gwd_devb(i, k) = dudt_gwd_devb(i, k) + dt*u_devb(i, k)
697 IF (branch .LT. 1)
THEN 707 vtgwb(k) = vtgwb(k) + dvdt_gwd_devb(i, k)
708 utgwb(k) = utgwb(k) + dudt_gwd_devb(i, k)
711 & , u_dev, v_dev, t_dev, pint_dev, pdel_dev, &
712 & rpdel_dev, lnpint_dev, rlat_dev, rhoi, ni, ti, nm&
713 & , dt, alpha, dback, kldv, kldvmn, ksrc, ksrcmn, &
714 & rdpldv, tau, taub, ubi, ubib, ubm, xv, xvb, yv, &
715 & yvb, utgw, utgwb, vtgw, vtgwb, ttgw, tauox_dev, &
716 & tauoy_dev, feo_dev, fepo_dev, utosrc, vtosrc, &
717 & ttosrc, tau0x, tau0y, effgworo_dev)
718 CALL gw_oro_bwd(i, pcols, pver, pgwv, u_dev, u_devb, v_dev, v_devb&
719 & , t_dev, sgh_dev, pmid_dev, pint_dev, pdel_dev, zm_dev, &
720 & nm, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, taub, ubi, &
721 & ubib, ubm, ubmb, xv, xvb, yv, yvb, kbotoro, rlat_dev)
724 IF (branch .LT. 1)
THEN 728 vtgwb(k) = vtgwb(k) + dvdt_gwd_devb(i, k)
729 vtosrcb(k) = vtosrcb(k) + dvdt_gwd_devb(i, k)
730 dvdt_gwd_devb(i, k) = 0.0_8
731 utgwb(k) = utgwb(k) + dudt_gwd_devb(i, k)
732 utosrcb(k) = utosrcb(k) + dudt_gwd_devb(i, k)
733 dudt_gwd_devb(i, k) = 0.0_8
741 & ktopbg, c, u_dev, v_dev, t_dev, pint_dev, &
742 & pdel_dev, rpdel_dev, lnpint_dev, rlat_dev, rhoi&
743 & , ni, ti, nm, dt, alpha, dback, kldv, kldvmn, &
744 & ksrc, ksrcmn, rdpldv, tau, taub, ubi, ubib, ubm&
745 & , xv, xvb, yv, yvb, utgw, utgwb, vtgw, vtgwb, &
746 & ttgw, taubx_dev, tauby_dev, feb_dev, fepb_dev, &
747 & utosrc, utosrcb, vtosrc, vtosrcb, ttosrc, tau0x&
748 & , tau0y, effgwbkg_dev)
749 CALL gw_bgnd_bwd(i, pcols, pver, c, u_dev, u_devb, v_dev, v_devb, &
750 & t_dev, pmid_dev, pint_dev, pdel_dev, rpdel_dev, &
751 & lnpint_dev, rlat_dev, kldv, kldvmn, ksrc, ksrcmn, &
752 & rdpldv, tau, ubi, ubib, ubm, ubmb, xv, xvb, yv, yvb, &
756 dvdt_gwd_devb(i, k) = 0.0_8
757 dudt_gwd_devb(i, k) = 0.0_8
761 SUBROUTINE gw_intr(i, pcols, pver, dt, pgwv, effgworo_dev, &
762 & effgwbkg_dev, pint_dev, t_dev, u_dev, v_dev, sgh_dev, pref_dev, &
763 & pmid_dev, pdel_dev, rpdel_dev, lnpint_dev, zm_dev, rlat_dev, &
764 & dudt_gwd_dev, dvdt_gwd_dev, dtdt_gwd_dev, dudt_org_dev, dvdt_org_dev&
765 & , dtdt_org_dev, taugwdx_dev, taugwdy_dev, tauox_dev, tauoy_dev, &
766 & feo_dev, taubkgx_dev, taubkgy_dev, taubx_dev, tauby_dev, feb_dev, &
767 & fepo_dev, fepb_dev, utbsrc_dev, vtbsrc_dev, ttbsrc_dev)
774 INTEGER,
INTENT(IN) :: pcols
776 INTEGER,
INTENT(IN) :: pver
778 REAL,
INTENT(IN) :: dt
780 INTEGER,
INTENT(IN) :: pgwv
782 REAL :: effgwbkg_dev(pcols)
784 REAL :: effgworo_dev(pcols)
786 REAL :: pint_dev(pcols, pver+1)
788 REAL :: t_dev(pcols, pver)
790 REAL :: u_dev(pcols, pver)
792 REAL :: v_dev(pcols, pver)
794 REAL :: sgh_dev(pcols)
796 REAL :: pref_dev(pver+1)
798 REAL :: pmid_dev(pcols, pver)
800 REAL :: pdel_dev(pcols, pver)
802 REAL :: rpdel_dev(pcols, pver)
804 REAL :: lnpint_dev(pcols, pver+1)
806 REAL :: zm_dev(pcols, pver)
808 REAL :: rlat_dev(pcols)
810 REAL :: dudt_gwd_dev(pcols, pver)
812 REAL :: dvdt_gwd_dev(pcols, pver)
814 REAL :: dtdt_gwd_dev(pcols, pver)
816 REAL :: dudt_org_dev(pcols, pver)
818 REAL :: dvdt_org_dev(pcols, pver)
820 REAL :: dtdt_org_dev(pcols, pver)
822 REAL :: taugwdx_dev(pcols)
824 REAL :: taugwdy_dev(pcols)
826 REAL :: tauox_dev(pcols, pver+1)
828 REAL :: tauoy_dev(pcols, pver+1)
830 REAL :: feo_dev(pcols, pver+1)
832 REAL :: fepo_dev(pcols, pver+1)
834 REAL :: taubkgx_dev(pcols)
836 REAL :: taubkgy_dev(pcols)
838 REAL :: taubx_dev(pcols, pver+1)
840 REAL :: tauby_dev(pcols, pver+1)
842 REAL :: feb_dev(pcols, pver+1)
844 REAL :: fepb_dev(pcols, pver+1)
846 REAL :: utbsrc_dev(pcols, pver)
848 REAL :: vtbsrc_dev(pcols, pver)
850 REAL :: ttbsrc_dev(pcols, pver)
853 INTEGER :: i, ii, k, kc
859 INTEGER :: ktopbg, ktoporo
900 REAL :: alpha(0:pver)
902 REAL :: dback(0:pver)
904 REAL :: c(-pgwv:pgwv)
906 REAL :: tau(-pgwv:pgwv, 0:pver)
924 IF (pref_dev(k+1) .LT.
p_src) kbotbg = k
929 CALL gw_prof(i, k, pcols, pver, u_dev, v_dev, t_dev, pmid_dev, &
930 & pint_dev, rhoi, ni, ti, nm)
935 IF (pgwv .GT. 0 .AND.
do_bgnd)
THEN 937 CALL gw_bgnd(i, pcols, pver, c, u_dev, v_dev, t_dev, pmid_dev, &
938 & pint_dev, pdel_dev, rpdel_dev, lnpint_dev, rlat_dev, kldv, &
939 & kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, pgwv, &
943 & , c, u_dev, v_dev, t_dev, pint_dev, pdel_dev, &
944 & rpdel_dev, lnpint_dev, rlat_dev, rhoi, ni, ti, nm&
945 & , dt, alpha, dback, kldv, kldvmn, ksrc, ksrcmn, &
946 & rdpldv, tau, ubi, ubm, xv, yv, utgw, vtgw, ttgw, &
947 & taubx_dev, tauby_dev, feb_dev, fepb_dev, utosrc, &
948 & vtosrc, ttosrc, tau0x, tau0y, effgwbkg_dev)
951 dudt_gwd_dev(i, k) = utgw(k) + utosrc(k)
952 dvdt_gwd_dev(i, k) = vtgw(k) + vtosrc(k)
960 dudt_gwd_dev(i, k) = 0.
961 dvdt_gwd_dev(i, k) = 0.
970 CALL gw_oro(i, pcols, pver, pgwv, u_dev, v_dev, t_dev, sgh_dev, &
971 & pmid_dev, pint_dev, pdel_dev, zm_dev, nm, kldv, kldvmn, ksrc&
972 & , ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, kbotoro, rlat_dev)
974 CALL gw_drag_prof(i, pcols, pver, pgwv, 0, kbotoro, ktoporo, c, &
975 & u_dev, v_dev, t_dev, pint_dev, pdel_dev, rpdel_dev, &
976 & lnpint_dev, rlat_dev, rhoi, ni, ti, nm, dt, alpha, &
977 & dback, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, &
978 & ubm, xv, yv, utgw, vtgw, ttgw, tauox_dev, tauoy_dev, &
979 & feo_dev, fepo_dev, utosrc, vtosrc, ttosrc, tau0x, &
980 & tau0y, effgworo_dev)
984 dudt_gwd_dev(i, k) = dudt_gwd_dev(i, k) + utgw(k)
985 dvdt_gwd_dev(i, k) = dvdt_gwd_dev(i, k) + vtgw(k)
990 u_dev(i, k) = u_dev(i, k) + dudt_gwd_dev(i, k)*dt
991 v_dev(i, k) = v_dev(i, k) + dvdt_gwd_dev(i, k)*dt
997 SUBROUTINE gw_prof(i, k, pcols, pver, u, v, t, pm, pi, rhoi, ni, ti, &
1009 INTEGER,
INTENT(IN) :: i
1011 INTEGER,
INTENT(IN) :: k
1013 INTEGER,
INTENT(IN) :: pcols
1015 INTEGER,
INTENT(IN) :: pver
1017 REAL :: u(pcols, pver)
1019 REAL :: v(pcols, pver)
1021 REAL :: t(pcols, pver)
1023 REAL :: pm(pcols, pver)
1025 REAL :: pi(pcols, 0:pver)
1027 REAL :: rhoi(0:pver)
1039 REAL :: t_new, t_new_
1050 CALL get_ti(t_new, ti(k))
1054 ELSE IF (k .GT. 0 .AND. k .LT. pver)
THEN 1055 ti(k) = 0.5*(t(i, k)+t(i, k+1))
1056 CALL get_ti(t_new, ti(k))
1058 dtdp = (t(i, k+1)-t(i, k))/(pm(i, k+1)-pm(i, k))
1059 CALL get_ti(t_new_, dtdp)
1061 IF (
n2min .LT. n2)
THEN 1069 ELSE IF (k .EQ. pver)
THEN 1071 CALL get_ti(t_new, ti(k))
1078 IF (k .GT. 0) nm(k) = 0.5*(ni(k-1)+ni(k))
1085 SUBROUTINE gw_oro_fwd(i, pcols, pver, pgwv, u, v, t, sgh, pm, pi, dpm&
1086 & , zm, nm, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv&
1097 INTEGER,
INTENT(IN) :: i
1099 INTEGER,
INTENT(IN) :: pcols
1101 INTEGER,
INTENT(IN) :: pver
1103 INTEGER,
INTENT(IN) :: pgwv
1105 REAL :: u(pcols, pver)
1107 REAL :: v(pcols, pver)
1109 REAL :: t(pcols, pver)
1113 REAL :: pm(pcols, pver)
1115 REAL :: pi(pcols, 0:pver)
1117 REAL :: dpm(pcols, pver)
1119 REAL :: zm(pcols, pver)
1133 REAL :: tau(-pgwv:pgwv, 0:pver)
1166 REAL :: u_new, v_new, t_new
1184 psrc = pi(i, pver-1)
1185 CALL get_ti(t_new, t(i, pver))
1186 rsrc = pm(i, pver)/(
mapl_rgas*t_new)*dpm(i, pver)
1187 CALL get_uv(u_new, u(i, pver))
1188 CALL get_uv(v_new, v(i, pver))
1189 usrc = u_new*dpm(i, pver)
1190 vsrc = v_new*dpm(i, pver)
1191 nsrc = nm(pver)*dpm(i, pver)
1193 DO k=pver-1,pver/2,-1
1194 IF (hdsp .GT. sqrt(zm(i, k)*zm(i, k+1)))
THEN 1197 CALL get_ti(t_new, t(i, k))
1198 rsrc = rsrc + pm(i, k)/(
mapl_rgas*t_new)*dpm(i, k)
1199 CALL get_uv(u_new, u(i, k))
1200 CALL get_uv(v_new, v(i, k))
1201 usrc = usrc + u_new*dpm(i, k)
1202 vsrc = vsrc + v_new*dpm(i, k)
1203 nsrc = nsrc + nm(k)*dpm(i, k)
1209 rsrc = rsrc/(pi(i, pver)-psrc)
1210 usrc = usrc/(pi(i, pver)-psrc)
1211 vsrc = vsrc/(pi(i, pver)-psrc)
1212 nsrc = nsrc/(pi(i, pver)-psrc)
1213 IF (usrc .EQ. 0. .AND. vsrc .EQ. 0.)
THEN 1221 ubsrc = sqrt(usrc**2 + vsrc**2)
1230 ubm(k) = u(i, k)*xv + v(i, k)*yv
1243 sghmax =
fcrit2*(ubsrc/nsrc)**2
1244 IF (hdsp**2 .GT. sghmax)
THEN 1251 tauoro =
oroko2*min1*rsrc*nsrc*ubsrc
1268 IF (ubi(kbot) .LT. 0. .OR. ubm(kbot) .LT. 0.)
THEN 1280 tau(0, kbot) = tauoro
1296 SUBROUTINE gw_oro_bwd(i, pcols, pver, pgwv, u, ub, v, vb, t, sgh, pm, &
1297 & pi, dpm, zm, nm, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, taub, ubi&
1298 & , ubib, ubm, ubmb, xv, xvb, yv, yvb, kbot, rlat)
1300 INTEGER,
INTENT(IN) :: i
1301 INTEGER,
INTENT(IN) :: pcols
1302 INTEGER,
INTENT(IN) :: pver
1303 INTEGER,
INTENT(IN) :: pgwv
1304 REAL :: u(pcols, pver)
1305 REAL :: ub(pcols, pver)
1306 REAL :: v(pcols, pver)
1307 REAL :: vb(pcols, pver)
1308 REAL :: t(pcols, pver)
1310 REAL :: pm(pcols, pver)
1311 REAL :: pi(pcols, 0:pver)
1312 REAL :: dpm(pcols, pver)
1313 REAL :: zm(pcols, pver)
1320 REAL :: tau(-pgwv:pgwv, 0:pver)
1321 REAL :: taub(-pgwv:pgwv, 0:pver)
1323 REAL :: ubib(0:pver)
1347 REAL :: u_new, v_new, t_new
1348 REAL :: u_newb, v_newb
1363 tauorob = taub(0, kbot)
1364 taub(0, kbot) = 0.0_8
1366 IF (.NOT.branch .LT. 1) tauorob = 0.0_8
1368 IF (branch .LT. 1)
THEN 1369 tempb0 =
oroko2*rsrc*nsrc*tauorob
1370 min1b = ubsrc*tempb0
1371 ubsrcb = min1*tempb0
1373 IF (branch .LT. 1)
THEN 1378 ubsrcb = ubsrcb +
fcrit2*2*ubsrc*sghmaxb/nsrc**2
1385 ubmb(k) = ubmb(k) + ubib(k)
1389 ubmb(1) = ubmb(1) + ubib(0)
1392 ub(i, k) = ub(i, k) + xv*ubmb(k)
1393 xvb = xvb + u(i, k)*ubmb(k)
1394 vb(i, k) = vb(i, k) + yv*ubmb(k)
1395 yvb = yvb + v(i, k)*ubmb(k)
1399 IF (branch .LT. 1)
THEN 1406 ubsrcb = ubsrcb - usrc*xvb/ubsrc**2 - vsrc*yvb/ubsrc**2
1407 IF (usrc**2 + vsrc**2 .EQ. 0.0)
THEN 1410 tempb = ubsrcb/(2.0*sqrt(usrc**2+vsrc**2))
1412 vsrcb = 2*vsrc*tempb + yvb/ubsrc
1414 usrcb = 2*usrc*tempb + xvb/ubsrc
1416 vsrcb = vsrcb/(pi(i, pver)-psrc)
1417 usrcb = usrcb/(pi(i, pver)-psrc)
1418 DO k=pver/2,pver-1,1
1420 IF (.NOT.branch .LT. 2)
THEN 1421 v_newb = dpm(i, k)*vsrcb
1422 u_newb = dpm(i, k)*usrcb
1423 CALL get_uv_b(v_new, v_newb, v(i, k), vb(i, k))
1424 CALL get_uv_b(u_new, u_newb, u(i, k), ub(i, k))
1427 v_newb = dpm(i, pver)*vsrcb
1428 u_newb = dpm(i, pver)*usrcb
1429 CALL get_uv_b(v_new, v_newb, v(i, pver), vb(i, pver))
1430 CALL get_uv_b(u_new, u_newb, u(i, pver), ub(i, pver))
1433 SUBROUTINE gw_oro(i, pcols, pver, pgwv, u, v, t, sgh, pm, pi, dpm, zm&
1434 & , nm, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, &
1445 INTEGER,
INTENT(IN) :: i
1447 INTEGER,
INTENT(IN) :: pcols
1449 INTEGER,
INTENT(IN) :: pver
1451 INTEGER,
INTENT(IN) :: pgwv
1453 REAL :: u(pcols, pver)
1455 REAL :: v(pcols, pver)
1457 REAL :: t(pcols, pver)
1461 REAL :: pm(pcols, pver)
1463 REAL :: pi(pcols, 0:pver)
1465 REAL :: dpm(pcols, pver)
1467 REAL :: zm(pcols, pver)
1481 REAL :: tau(-pgwv:pgwv, 0:pver)
1514 REAL :: u_new, v_new, t_new
1533 psrc = pi(i, pver-1)
1534 CALL get_ti(t_new, t(i, pver))
1535 rsrc = pm(i, pver)/(
mapl_rgas*t_new)*dpm(i, pver)
1536 CALL get_uv(u_new, u(i, pver))
1537 CALL get_uv(v_new, v(i, pver))
1538 usrc = u_new*dpm(i, pver)
1539 vsrc = v_new*dpm(i, pver)
1540 nsrc = nm(pver)*dpm(i, pver)
1542 DO k=pver-1,pver/2,-1
1543 IF (hdsp .GT. sqrt(zm(i, k)*zm(i, k+1)))
THEN 1547 CALL get_ti(t_new, t(i, k))
1548 rsrc = rsrc + pm(i, k)/(
mapl_rgas*t_new)*dpm(i, k)
1549 CALL get_uv(u_new, u(i, k))
1550 CALL get_uv(v_new, v(i, k))
1551 usrc = usrc + u_new*dpm(i, k)
1552 vsrc = vsrc + v_new*dpm(i, k)
1553 nsrc = nsrc + nm(k)*dpm(i, k)
1556 rsrc = rsrc/(pi(i, pver)-psrc)
1557 usrc = usrc/(pi(i, pver)-psrc)
1558 vsrc = vsrc/(pi(i, pver)-psrc)
1559 nsrc = nsrc/(pi(i, pver)-psrc)
1560 IF (usrc .EQ. 0. .AND. vsrc .EQ. 0.)
THEN 1565 ubsrc = sqrt(usrc**2 + vsrc**2)
1571 ubm(k) = u(i, k)*xv + v(i, k)*yv
1582 sghmax =
fcrit2*(ubsrc/nsrc)**2
1583 IF (hdsp**2 .GT. sghmax)
THEN 1588 tauoro =
oroko2*min1*rsrc*nsrc*ubsrc
1604 IF (ubi(kbot) .LT. 0. .OR. ubm(kbot) .LT. 0.)
THEN 1614 tau(0, kbot) = tauoro
1620 IF (ksrcmn .GT. ksrc)
THEN 1625 IF (kldvmn .GT. kldv)
THEN 1630 IF (kldv .NE. pver) rdpldv = 1./(pi(i, kldv)-pi(i, pver))
1632 IF (
fracldv .LE. 0.) kldvmn = pver
1639 SUBROUTINE gw_bgnd_fwd(i, pcols, pver, c, u, v, t, pm, pi, dpm, rdpm, &
1640 & piln, rlat, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, &
1661 REAL :: c(-ngwv:ngwv)
1663 REAL :: u(pcols, pver)
1665 REAL :: v(pcols, pver)
1667 REAL :: t(pcols, pver)
1669 REAL :: pm(pcols, pver)
1671 REAL :: pi(pcols, 0:pver)
1673 REAL :: dpm(pcols, pver)
1675 REAL :: rdpm(pcols, pver)
1677 REAL :: piln(pcols, 0:pver)
1691 REAL :: tau(-ngwv:ngwv, 0:pver)
1717 REAL :: u_new, v_new, tau_new
1740 usrc = 0.5*(u(i, kbot+1)+u(i, kbot))
1741 vsrc = 0.5*(v(i, kbot+1)+v(i, kbot))
1742 x1 = sqrt(usrc**2 + vsrc**2)
1744 IF (x1 .LT. y1)
THEN 1751 IF (usrc .EQ. 0. .AND. vsrc .EQ. 0.)
THEN 1762 ubm(k) = u(i, k)*xv + v(i, k)*yv
1778 latdeg = rlat(i)*180./
pi_gwd 1780 IF (-15.3 .LT. latdeg .AND. latdeg .LT. 15.3)
THEN 1781 IF (latdeg .GE. 0.)
THEN 1786 flat_gw = 1.2*exp(-(dble((abs1-3.)/8.0)**2))
1787 IF (latdeg .GE. 0.)
THEN 1792 IF (flat_gw .LT. 1.2 .AND. abs2 .LE. 3.) flat_gw = 1.2
1793 ELSE IF (latdeg .GT. -31. .AND. latdeg .LE. -15.3)
THEN 1795 ELSE IF (latdeg .LT. 31. .AND. latdeg .GE. 15.3)
THEN 1797 ELSE IF (latdeg .GT. -60. .AND. latdeg .LE. -31.)
THEN 1798 IF (latdeg .GE. 0.)
THEN 1803 flat_gw = 0.50*exp(-(dble((abs3-60.)/23.)**2))
1804 ELSE IF (latdeg .LT. 60. .AND. latdeg .GE. 31.)
THEN 1805 IF (latdeg .GE. 0.)
THEN 1810 flat_gw = 0.50*exp(-(dble((abs4-60.)/23.)**2))
1811 ELSE IF (latdeg .LE. -60.)
THEN 1812 IF (latdeg .GE. 0.)
THEN 1817 flat_gw = 0.50*exp(-(dble((abs5-60.)/70.)**2))
1818 ELSE IF (latdeg .GE. 60.)
THEN 1819 IF (latdeg .GE. 0.)
THEN 1824 flat_gw = 0.50*exp(-(dble((abs6-60.)/70.)**2))
1826 tauback = tauback*flat_gw
1831 tau(l, kbot) = tauback*exp(-((c(l)/30.)**2))
1835 tau(0, kbot) = tauback
1844 SUBROUTINE gw_bgnd_bwd(i, pcols, pver, c, u, ub, v, vb, t, pm, pi, dpm&
1845 & , rdpm, piln, rlat, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, &
1846 & ubib, ubm, ubmb, xv, xvb, yv, yvb, ngwv, kbot)
1853 REAL :: c(-ngwv:ngwv)
1854 REAL :: u(pcols, pver)
1855 REAL :: ub(pcols, pver)
1856 REAL :: v(pcols, pver)
1857 REAL :: vb(pcols, pver)
1858 REAL :: t(pcols, pver)
1859 REAL :: pm(pcols, pver)
1860 REAL :: pi(pcols, 0:pver)
1861 REAL :: dpm(pcols, pver)
1862 REAL :: rdpm(pcols, pver)
1863 REAL :: piln(pcols, 0:pver)
1870 REAL :: tau(-ngwv:ngwv, 0:pver)
1872 REAL :: ubib(0:pver)
1891 REAL :: u_new, v_new, tau_new
1912 ubmb(k) = ubmb(k) + ubib(k)
1915 ubmb(1) = ubmb(1) + ubib(0)
1917 ub(i, k) = ub(i, k) + xv*ubmb(k)
1918 xvb = xvb + u(i, k)*ubmb(k)
1919 vb(i, k) = vb(i, k) + yv*ubmb(k)
1920 yvb = yvb + v(i, k)*ubmb(k)
1924 IF (branch .LT. 1)
THEN 1926 ubsrcb = -(usrc*xvb/ubsrc**2) - vsrc*yvb/ubsrc**2
1934 IF (branch .LT. 1)
THEN 1939 IF (usrc**2 + vsrc**2 .EQ. 0.0)
THEN 1942 tempb = x1b/(2.0*sqrt(usrc**2+vsrc**2))
1944 usrcb = usrcb + 2*usrc*tempb
1945 vsrcb = vsrcb + 2*vsrc*tempb
1946 vb(i, kbot+1) = vb(i, kbot+1) + 0.5*vsrcb
1947 vb(i, kbot) = vb(i, kbot) + 0.5*vsrcb
1948 ub(i, kbot+1) = ub(i, kbot+1) + 0.5*usrcb
1949 ub(i, kbot) = ub(i, kbot) + 0.5*usrcb
1952 SUBROUTINE gw_bgnd(i, pcols, pver, c, u, v, t, pm, pi, dpm, rdpm, piln&
1953 & , rlat, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, &
1974 REAL :: c(-ngwv:ngwv)
1976 REAL :: u(pcols, pver)
1978 REAL :: v(pcols, pver)
1980 REAL :: t(pcols, pver)
1982 REAL :: pm(pcols, pver)
1984 REAL :: pi(pcols, 0:pver)
1986 REAL :: dpm(pcols, pver)
1988 REAL :: rdpm(pcols, pver)
1990 REAL :: piln(pcols, 0:pver)
2004 REAL :: tau(-ngwv:ngwv, 0:pver)
2030 REAL :: u_new, v_new, tau_new
2056 usrc = 0.5*(u(i, kbot+1)+u(i, kbot))
2057 vsrc = 0.5*(v(i, kbot+1)+v(i, kbot))
2058 x1 = sqrt(usrc**2 + vsrc**2)
2060 IF (x1 .LT. y1)
THEN 2065 IF (usrc .EQ. 0. .AND. vsrc .EQ. 0.)
THEN 2074 ubm(k) = u(i, k)*xv + v(i, k)*yv
2087 latdeg = rlat(i)*180./
pi_gwd 2089 IF (-15.3 .LT. latdeg .AND. latdeg .LT. 15.3)
THEN 2090 IF (latdeg .GE. 0.)
THEN 2095 flat_gw = 1.2*exp(-(dble((abs1-3.)/8.0)**2))
2096 IF (latdeg .GE. 0.)
THEN 2101 IF (flat_gw .LT. 1.2 .AND. abs2 .LE. 3.) flat_gw = 1.2
2102 ELSE IF (latdeg .GT. -31. .AND. latdeg .LE. -15.3)
THEN 2104 ELSE IF (latdeg .LT. 31. .AND. latdeg .GE. 15.3)
THEN 2106 ELSE IF (latdeg .GT. -60. .AND. latdeg .LE. -31.)
THEN 2107 IF (latdeg .GE. 0.)
THEN 2112 flat_gw = 0.50*exp(-(dble((abs3-60.)/23.)**2))
2113 ELSE IF (latdeg .LT. 60. .AND. latdeg .GE. 31.)
THEN 2114 IF (latdeg .GE. 0.)
THEN 2119 flat_gw = 0.50*exp(-(dble((abs4-60.)/23.)**2))
2120 ELSE IF (latdeg .LE. -60.)
THEN 2121 IF (latdeg .GE. 0.)
THEN 2126 flat_gw = 0.50*exp(-(dble((abs5-60.)/70.)**2))
2127 ELSE IF (latdeg .GE. 60.)
THEN 2128 IF (latdeg .GE. 0.)
THEN 2133 flat_gw = 0.50*exp(-(dble((abs6-60.)/70.)**2))
2135 tauback = tauback*flat_gw
2140 tau(l, kbot) = tauback*exp(-((c(l)/30.)**2))
2141 tau(-l, kbot) = tau(l, kbot)
2143 tau(0, kbot) = tauback
2157 & , u, v, t, pi, dpm, rdpm, piln, rlat, rhoi, ni, ti, nm, dt, alpha, &
2158 & dback, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, ut&
2159 & , vt, tt, taugwx, taugwy, fegw, fepgw, dusrc, dvsrc, dtsrc, tau0x, &
2174 INTEGER,
INTENT(IN) :: i
2176 INTEGER,
INTENT(IN) :: pcols
2178 INTEGER,
INTENT(IN) :: pver
2180 INTEGER,
INTENT(IN) :: kbot
2182 INTEGER,
INTENT(IN) :: ktop
2184 INTEGER,
INTENT(IN) :: pgwv
2186 INTEGER,
INTENT(IN) :: ngwv
2188 INTEGER,
INTENT(IN) :: kldv
2190 INTEGER,
INTENT(IN) :: kldvmn
2192 INTEGER,
INTENT(IN) :: ksrc
2194 INTEGER,
INTENT(IN) :: ksrcmn
2196 REAL :: c(-pgwv:pgwv)
2198 REAL :: u(pcols, pver)
2200 REAL :: v(pcols, pver)
2202 REAL :: t(pcols, pver)
2204 REAL :: pi(pcols, 0:pver)
2206 REAL :: dpm(pcols, pver)
2208 REAL :: rdpm(pcols, pver)
2210 REAL :: piln(pcols, 0:pver)
2213 REAL :: rhoi(0:pver)
2223 REAL :: alpha(0:pver)
2225 REAL :: dback(0:pver)
2237 REAL :: effgw(pcols)
2239 REAL :: tau(-pgwv:pgwv, 0:pver)
2247 REAL :: taugwx(pcols, 0:pver)
2249 REAL :: taugwy(pcols, 0:pver)
2251 REAL :: fegw(pcols, 0:pver)
2253 REAL :: fepgw(pcols, 0:pver)
2296 REAL :: dzm, hscal, tautmp
2319 REAL :: tau_min, cmu_, t_new
2329 IF (k .LE. kbot - 1)
THEN 2357 IF (k .LE. kbot - 1)
THEN 2360 ubmc = ubi(k) - c(l)
2361 IF (ngwv .GT. 0)
THEN 2364 IF (-15.0 .LT. rlat(i)*180./
pi_gwd .AND. rlat(i)*180./
pi_gwd&
2372 IF (pi(i, k) .LT. 1000.0)
THEN 2373 zfac = (pi(i, k)/1000.0)**3
2377 IF (rlat(i)*180./
pi_gwd .LT. -20.0)
THEN 2387 x1 = effkwvmap*rhoi(k)*ubmc**3/(2.*ni(k))
2388 IF (x1 .GE. 0.)
THEN 2395 IF (tausat .LE.
taumin)
THEN 2401 IF (ubmc*(ubi(k+1)-c(l)) .LE. 0.0)
THEN 2407 IF (k .EQ. ktop)
THEN 2414 IF (k .EQ. ktop + 1)
THEN 2415 tausat = tausat*0.02
2420 IF (k .EQ. ktop + 2)
THEN 2421 tausat = tausat*0.05
2426 IF (k .EQ. ktop + 3)
THEN 2427 tausat = tausat*0.10
2432 IF (k .EQ. ktop + 4)
THEN 2433 tausat = tausat*0.20
2438 IF (k .EQ. ktop + 5)
THEN 2439 tausat = tausat*0.50
2446 IF (tau_min .GT. tau(l, k+1))
THEN 2447 tau_min = tau(l, k+1)
2468 IF (k .LE. kbot)
THEN 2471 ubtl =
mapl_grav*(tau(l, k)-tau(l, k-1))*rdpm(i, k)
2473 utl = sign(ubtl, c(l) - ubi(k))
2484 IF (k .LE. kbot)
THEN 2485 ut(k) = ubt*xv*effgw(i)
2486 vt(k) = ubt*yv*effgw(i)
2497 IF (k .LE. kbot)
THEN 2500 fpmx = cmu_*tau(l, k)*xv*effgw(i)
2501 fpmy = cmu_*tau(l, k)*yv*effgw(i)
2502 fe = cmu*cmu_*tau(l, k)*effgw(i)
2503 fpe = c(l)*cmu_*tau(l, k)*effgw(i)
2505 taugwx(i, k) = taugwx(i, k) + fpmx
2506 taugwy(i, k) = taugwy(i, k) + fpmy
2507 fegw(i, k) = fegw(i, k) + fe
2508 fepgw(i, k) = fepgw(i, k) + fpe
2518 x2 = sqrt(ut(k)**2 + vt(k)**2)
2519 IF (x2 .LT. uhtmax)
THEN 2527 IF (uhtmax .GT.
tndmax)
THEN 2553 & , u, v, t, pi, dpm, rdpm, piln, rlat, rhoi, ni, ti, nm, dt, alpha, &
2554 & dback, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, taub, ubi, ubib, ubm&
2555 & , xv, xvb, yv, yvb, ut, utb, vt, vtb, tt, taugwx, taugwy, fegw, &
2556 & fepgw, dusrc, dvsrc, dtsrc, tau0x, tau0y, effgw)
2558 INTEGER,
INTENT(IN) :: i
2559 INTEGER,
INTENT(IN) :: pcols
2560 INTEGER,
INTENT(IN) :: pver
2561 INTEGER,
INTENT(IN) :: kbot
2562 INTEGER,
INTENT(IN) :: ktop
2563 INTEGER,
INTENT(IN) :: pgwv
2564 INTEGER,
INTENT(IN) :: ngwv
2565 INTEGER,
INTENT(IN) :: kldv
2566 INTEGER,
INTENT(IN) :: kldvmn
2567 INTEGER,
INTENT(IN) :: ksrc
2568 INTEGER,
INTENT(IN) :: ksrcmn
2569 REAL :: c(-pgwv:pgwv)
2570 REAL :: u(pcols, pver)
2571 REAL :: v(pcols, pver)
2572 REAL :: t(pcols, pver)
2573 REAL :: pi(pcols, 0:pver)
2574 REAL :: dpm(pcols, pver)
2575 REAL :: rdpm(pcols, pver)
2576 REAL :: piln(pcols, 0:pver)
2578 REAL :: rhoi(0:pver)
2583 REAL :: alpha(0:pver)
2584 REAL :: dback(0:pver)
2587 REAL :: ubib(0:pver)
2593 REAL :: effgw(pcols)
2594 REAL :: tau(-pgwv:pgwv, 0:pver)
2595 REAL :: taub(-pgwv:pgwv, 0:pver)
2601 REAL :: taugwx(pcols, 0:pver)
2602 REAL :: taugwy(pcols, 0:pver)
2603 REAL :: fegw(pcols, 0:pver)
2604 REAL :: fepgw(pcols, 0:pver)
2629 REAL :: dzm, hscal, tautmp
2651 REAL :: tau_min, cmu_, t_new
2674 utfacb = utfacb + ut(k)*utb(k) + vt(k)*vtb(k)
2675 vtb(k) = utfac*vtb(k)
2676 utb(k) = utfac*utb(k)
2679 IF (branch .LT. 1)
THEN 2682 uhtmaxb = -(
tndmax*utfacb/uhtmax**2)
2686 IF (branch .LT. 2)
THEN 2692 IF (ut(k)**2 + vt(k)**2 .EQ. 0.0)
THEN 2695 tempb0 = x2b/(2.0*sqrt(ut(k)**2+vt(k)**2))
2697 utb(k) = utb(k) + 2*ut(k)*tempb0
2698 vtb(k) = vtb(k) + 2*vt(k)*tempb0
2705 IF (branch .LT. 2)
THEN 2708 ubtb = effgw(i)*xv*utb(k) + effgw(i)*yv*vtb(k)
2709 yvb = yvb + effgw(i)*ubt*vtb(k)
2711 xvb = xvb + effgw(i)*ubt*utb(k)
2716 IF (.NOT.branch .LT. 2)
THEN 2718 ubtlb = sign(1.d0, ubtl*(c(l)-ubi(k)))*utlb
2721 taub(l, k) = taub(l, k) + tempb
2722 taub(l, k-1) = taub(l, k-1) - tempb
2731 IF (.NOT.branch .LT. 2)
THEN 2732 tau_minb = taub(l, k)
2735 IF (.NOT.branch .LT. 1)
THEN 2736 taub(l, k+1) = taub(l, k+1) + tau_minb
2741 IF (.NOT.branch .LT. 1) tausatb = 0.50*tausatb
2743 IF (.NOT.branch .LT. 1) tausatb = 0.20*tausatb
2745 IF (.NOT.branch .LT. 1) tausatb = 0.10*tausatb
2747 IF (.NOT.branch .LT. 1) tausatb = 0.05*tausatb
2749 IF (.NOT.branch .LT. 1) tausatb = 0.02*tausatb
2751 IF (.NOT.branch .LT. 1) tausatb = 0.0_8
2753 IF (.NOT.branch .LT. 1) tausatb = 0.0_8
2755 IF (.NOT.branch .LT. 1) tausatb = 0.0_8
2757 IF (branch .LT. 1)
THEN 2762 ubmcb = effkwvmap*rhoi(k)*3*ubmc**2*x1b/(2.*ni(k))
2764 IF (branch .LT. 2)
THEN 2765 IF (branch .LT. 1)
THEN 2774 ubib(k) = ubib(k) + ubmcb
2785 IF (.NOT.branch .LT. 2) taub(l, k) = 0.0_8
2790 SUBROUTINE gw_drag_prof(i, pcols, pver, pgwv, ngwv, kbot, ktop, c, u, &
2791 & v, t, pi, dpm, rdpm, piln, rlat, rhoi, ni, ti, nm, dt, alpha, dback&
2792 & , kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, ut, vt&
2793 & , tt, taugwx, taugwy, fegw, fepgw, dusrc, dvsrc, dtsrc, tau0x, tau0y&
2808 INTEGER,
INTENT(IN) :: i
2810 INTEGER,
INTENT(IN) :: pcols
2812 INTEGER,
INTENT(IN) :: pver
2814 INTEGER,
INTENT(IN) :: kbot
2816 INTEGER,
INTENT(IN) :: ktop
2818 INTEGER,
INTENT(IN) :: pgwv
2820 INTEGER,
INTENT(IN) :: ngwv
2822 INTEGER,
INTENT(IN) :: kldv
2824 INTEGER,
INTENT(IN) :: kldvmn
2826 INTEGER,
INTENT(IN) :: ksrc
2828 INTEGER,
INTENT(IN) :: ksrcmn
2830 REAL :: c(-pgwv:pgwv)
2832 REAL :: u(pcols, pver)
2834 REAL :: v(pcols, pver)
2836 REAL :: t(pcols, pver)
2838 REAL :: pi(pcols, 0:pver)
2840 REAL :: dpm(pcols, pver)
2842 REAL :: rdpm(pcols, pver)
2844 REAL :: piln(pcols, 0:pver)
2847 REAL :: rhoi(0:pver)
2857 REAL :: alpha(0:pver)
2859 REAL :: dback(0:pver)
2871 REAL :: effgw(pcols)
2873 REAL :: tau(-pgwv:pgwv, 0:pver)
2881 REAL :: taugwx(pcols, 0:pver)
2883 REAL :: taugwy(pcols, 0:pver)
2885 REAL :: fegw(pcols, 0:pver)
2887 REAL :: fepgw(pcols, 0:pver)
2930 REAL :: dzm, hscal, tautmp
2953 REAL :: tau_min, cmu_, t_new
2963 IF (k .LE. kbot - 1) tau(l, k) = 0.
2993 IF (k .LE. kbot - 1)
THEN 2995 ubmc = ubi(k) - c(l)
2996 IF (ngwv .GT. 0)
THEN 2998 IF (-15.0 .LT. rlat(i)*180./
pi_gwd .AND. rlat(i)*180./
pi_gwd&
3001 IF (pi(i, k) .LT. 1000.0)
THEN 3002 zfac = (pi(i, k)/1000.0)**3
3006 IF (rlat(i)*180./
pi_gwd .LT. -20.0)
THEN 3012 x1 = effkwvmap*rhoi(k)*ubmc**3/(2.*ni(k))
3013 IF (x1 .GE. 0.)
THEN 3018 IF (tausat .LE.
taumin) tausat = 0.0
3019 IF (ubmc*(ubi(k+1)-c(l)) .LE. 0.0) tausat = 0.0
3020 IF (k .EQ. ktop) tausat = 0.
3022 IF (k .EQ. ktop + 1) tausat = tausat*0.02
3023 IF (k .EQ. ktop + 2) tausat = tausat*0.05
3024 IF (k .EQ. ktop + 3) tausat = tausat*0.10
3025 IF (k .EQ. ktop + 4) tausat = tausat*0.20
3026 IF (k .EQ. ktop + 5) tausat = tausat*0.50
3029 IF (tau_min .GT. tau(l, k+1)) tau_min = tau(l, k+1)
3043 IF (k .LE. kbot)
THEN 3045 ubtl =
mapl_grav*(tau(l, k)-tau(l, k-1))*rdpm(i, k)
3047 utl = sign(ubtl, c(l) - ubi(k))
3052 ttl = (c(l)-ubm(k))*utl/
mapl_cp 3058 IF (k .LE. kbot)
THEN 3059 ut(k) = ubt*xv*effgw(i)
3060 vt(k) = ubt*yv*effgw(i)
3061 tt(k) = tbt*effgw(i)
3072 IF (k .GE. kbot + 1)
THEN 3074 pm = (pi(i, k-1)+pi(i, k))*0.5
3075 CALL get_ti(t_new, t(i, k))
3085 IF (k .LE. kbot)
THEN 3088 fpmx = cmu_*tau(l, k)*xv*effgw(i)
3089 fpmy = cmu_*tau(l, k)*yv*effgw(i)
3090 fe = cmu*cmu_*tau(l, k)*effgw(i)
3091 fpe = c(l)*cmu_*tau(l, k)*effgw(i)
3092 IF (k .EQ. kbot)
THEN 3093 fpml = fpmx*xv + fpmy*yv
3096 IF (k .EQ. ktop)
THEN 3097 fpmt = fpmx*xv + fpmy*yv
3101 taugwx(i, k) = taugwx(i, k) + fpmx
3102 taugwy(i, k) = taugwy(i, k) + fpmy
3103 fegw(i, k) = fegw(i, k) + fe
3104 fepgw(i, k) = fepgw(i, k) + fpe
3108 IF (k .GE. kbot + 1)
THEN 3111 pm = (pi(i, k-1)+pi(i, k))*0.5
3112 CALL get_ti(t_new, t(i, k))
3114 dusrcl = -((fpml-fpmt)/(rhom*zlb)*xv)
3115 dvsrcl = -((fpml-fpmt)/(rhom*zlb)*yv)
3116 dtsrcl = -((fpel-fpet-ubm(k)*(fpml-fpmt))/(rhom*zlb*
mapl_cp))
3118 dusrc(k) = dusrc(k) + dusrcl
3119 dvsrc(k) = dvsrc(k) + dvsrcl
3120 dtsrc(k) = dtsrc(k) + dtsrcl
3126 IF (ngwv .EQ. 0)
THEN 3138 x2 = sqrt(ut(k)**2 + vt(k)**2)
3139 IF (x2 .LT. uhtmax)
THEN 3151 dusrc(k) = dusrc(k)*utfac
3152 dvsrc(k) = dvsrc(k)*utfac
3153 dtsrc(k) = dtsrc(k)*utfac
3159 tau0x = tau(0, kbot)*xv*effgw(i)*utfac
3160 tau0y = tau(0, kbot)*yv*effgw(i)*utfac
3168 & , c, u, v, t, pi, dpm, rdpm, piln, rlat, rhoi, ni, ti, nm, dt, alpha&
3169 & , dback, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, taub, ubi, ubib, &
3170 & ubm, xv, xvb, yv, yvb, ut, utb, vt, vtb, tt, taugwx, taugwy, fegw, &
3171 & fepgw, dusrc, dusrcb, dvsrc, dvsrcb, dtsrc, tau0x, tau0y, effgw)
3185 INTEGER,
INTENT(IN) :: i
3187 INTEGER,
INTENT(IN) :: pcols
3189 INTEGER,
INTENT(IN) :: pver
3191 INTEGER,
INTENT(IN) :: kbot
3193 INTEGER,
INTENT(IN) :: ktop
3195 INTEGER,
INTENT(IN) :: pgwv
3197 INTEGER,
INTENT(IN) :: ngwv
3199 INTEGER,
INTENT(IN) :: kldv
3201 INTEGER,
INTENT(IN) :: kldvmn
3203 INTEGER,
INTENT(IN) :: ksrc
3205 INTEGER,
INTENT(IN) :: ksrcmn
3207 REAL :: c(-pgwv:pgwv)
3209 REAL :: u(pcols, pver)
3211 REAL :: v(pcols, pver)
3213 REAL :: t(pcols, pver)
3215 REAL :: pi(pcols, 0:pver)
3217 REAL :: dpm(pcols, pver)
3219 REAL :: rdpm(pcols, pver)
3221 REAL :: piln(pcols, 0:pver)
3224 REAL :: rhoi(0:pver)
3234 REAL :: alpha(0:pver)
3236 REAL :: dback(0:pver)
3241 REAL :: ubib(0:pver)
3251 REAL :: effgw(pcols)
3253 REAL :: tau(-pgwv:pgwv, 0:pver)
3254 REAL :: taub(-pgwv:pgwv, 0:pver)
3264 REAL :: taugwx(pcols, 0:pver)
3266 REAL :: taugwy(pcols, 0:pver)
3268 REAL :: fegw(pcols, 0:pver)
3270 REAL :: fepgw(pcols, 0:pver)
3273 REAL :: dusrcb(pver)
3276 REAL :: dvsrcb(pver)
3319 REAL :: dzm, hscal, tautmp
3351 REAL :: tau_min, cmu_, t_new
3371 IF (k .LE. kbot - 1) tau(l, k) = 0.
3389 IF (k .LE. kbot - 1)
THEN 3392 ubmc = ubi(k) - c(l)
3393 IF (ngwv .GT. 0)
THEN 3396 IF (-15.0 .LT. rlat(i)*180./
pi_gwd .AND. rlat(i)*180./
pi_gwd&
3404 IF (pi(i, k) .LT. 1000.0)
THEN 3405 zfac = (pi(i, k)/1000.0)**3
3409 IF (rlat(i)*180./
pi_gwd .LT. -20.0)
THEN 3419 x1 = effkwvmap*rhoi(k)*ubmc**3/(2.*ni(k))
3420 IF (x1 .GE. 0.)
THEN 3427 IF (tausat .LE.
taumin)
THEN 3433 IF (ubmc*(ubi(k+1)-c(l)) .LE. 0.0)
THEN 3439 IF (k .EQ. ktop)
THEN 3446 IF (k .EQ. ktop + 1)
THEN 3447 tausat = tausat*0.02
3452 IF (k .EQ. ktop + 2)
THEN 3453 tausat = tausat*0.05
3458 IF (k .EQ. ktop + 3)
THEN 3459 tausat = tausat*0.10
3464 IF (k .EQ. ktop + 4)
THEN 3465 tausat = tausat*0.20
3470 IF (k .EQ. ktop + 5)
THEN 3471 tausat = tausat*0.50
3478 IF (tau_min .GT. tau(l, k+1))
THEN 3479 tau_min = tau(l, k+1)
3500 IF (k .LE. kbot)
THEN 3503 ubtl =
mapl_grav*(tau(l, k)-tau(l, k-1))*rdpm(i, k)
3505 utl = sign(ubtl, c(l) - ubi(k))
3516 IF (k .LE. kbot)
THEN 3517 ut(k) = ubt*xv*effgw(i)
3518 vt(k) = ubt*yv*effgw(i)
3532 IF (k .GE. kbot + 1)
THEN 3534 pm = (pi(i, k-1)+pi(i, k))*0.5
3535 CALL get_ti(t_new, t(i, k))
3545 IF (k .LE. kbot)
THEN 3550 fpmx = cmu_*tau(l, k)*xv*effgw(i)
3552 fpmy = cmu_*tau(l, k)*yv*effgw(i)
3553 IF (k .EQ. kbot)
THEN 3555 fpml = fpmx*xv + fpmy*yv
3560 IF (k .EQ. ktop)
THEN 3562 fpmt = fpmx*xv + fpmy*yv
3572 IF (k .GE. kbot + 1)
THEN 3574 pm = (pi(i, k-1)+pi(i, k))*0.5
3575 CALL get_ti(t_new, t(i, k))
3578 dusrcl = -((fpml-fpmt)/(rhom*zlb)*xv)
3579 dvsrcl = -((fpml-fpmt)/(rhom*zlb)*yv)
3581 dusrc(k) = dusrc(k) + dusrcl
3582 dvsrc(k) = dvsrc(k) + dvsrcl
3591 IF (ngwv .EQ. 0)
THEN 3605 x2 = sqrt(ut(k)**2 + vt(k)**2)
3606 IF (x2 .LT. uhtmax)
THEN 3614 IF (uhtmax .GT.
tndmax)
THEN 3622 utfacb = utfacb + dusrc(k)*dusrcb(k) + ut(k)*utb(k) + vt(k)*vtb(k)&
3623 & + dvsrc(k)*dvsrcb(k)
3624 dvsrcb(k) = utfac*dvsrcb(k)
3625 dusrcb(k) = utfac*dusrcb(k)
3626 vtb(k) = utfac*vtb(k)
3627 utb(k) = utfac*utb(k)
3630 IF (branch .LT. 1)
THEN 3633 uhtmaxb = -(
tndmax*utfacb/uhtmax**2)
3637 IF (branch .LT. 2)
THEN 3643 IF (ut(k)**2 + vt(k)**2 .EQ. 0.0)
THEN 3646 tempb4 = x2b/(2.0*sqrt(ut(k)**2+vt(k)**2))
3648 utb(k) = utb(k) + 2*ut(k)*tempb4
3649 vtb(k) = vtb(k) + 2*vt(k)*tempb4
3653 IF (.NOT.branch .LT. 2)
THEN 3665 IF (.NOT.branch .LT. 2)
THEN 3668 tempb2 = -(dvsrclb/(rhom*zlb))
3669 tempb3 = -(dusrclb/(rhom*zlb))
3670 fpmlb = fpmlb + xv*tempb3 + yv*tempb2
3671 fpmtb = fpmtb - xv*tempb3 - yv*tempb2
3672 yvb = yvb + (fpml-fpmt)*tempb2
3673 xvb = xvb + (fpml-fpmt)*tempb3
3679 IF (branch .LT. 3)
THEN 3680 IF (branch .LT. 2)
THEN 3689 xvb = xvb + fpmx*fpmtb
3691 yvb = yvb + fpmy*fpmtb
3695 IF (.NOT.branch .LT. 1)
THEN 3697 fpmxb = fpmxb + xv*fpmlb
3698 xvb = xvb + fpmx*fpmlb
3699 fpmyb = fpmyb + yv*fpmlb
3700 yvb = yvb + fpmy*fpmlb
3704 tempb0 = cmu_*effgw(i)*fpmyb
3705 tempb1 = cmu_*effgw(i)*fpmxb
3706 taub(l, k) = taub(l, k) + xv*tempb1 + yv*tempb0
3707 yvb = yvb + tau(l, k)*tempb0
3709 xvb = xvb + tau(l, k)*tempb1
3716 IF (branch .LT. 2)
THEN 3719 ubtb = effgw(i)*xv*utb(k) + effgw(i)*yv*vtb(k)
3720 yvb = yvb + effgw(i)*ubt*vtb(k)
3722 xvb = xvb + effgw(i)*ubt*utb(k)
3727 IF (.NOT.branch .LT. 2)
THEN 3729 ubtlb = sign(1.d0, ubtl*(c(l)-ubi(k)))*utlb
3732 taub(l, k) = taub(l, k) + tempb
3733 taub(l, k-1) = taub(l, k-1) - tempb
3741 IF (.NOT.branch .LT. 2)
THEN 3742 tau_minb = taub(l, k)
3745 IF (.NOT.branch .LT. 1)
THEN 3746 taub(l, k+1) = taub(l, k+1) + tau_minb
3751 IF (.NOT.branch .LT. 1) tausatb = 0.50*tausatb
3753 IF (.NOT.branch .LT. 1) tausatb = 0.20*tausatb
3755 IF (.NOT.branch .LT. 1) tausatb = 0.10*tausatb
3757 IF (.NOT.branch .LT. 1) tausatb = 0.05*tausatb
3759 IF (.NOT.branch .LT. 1) tausatb = 0.02*tausatb
3761 IF (.NOT.branch .LT. 1) tausatb = 0.0_8
3763 IF (.NOT.branch .LT. 1) tausatb = 0.0_8
3765 IF (.NOT.branch .LT. 1) tausatb = 0.0_8
3767 IF (branch .LT. 1)
THEN 3772 ubmcb = effkwvmap*rhoi(k)*3*ubmc**2*x1b/(2.*ni(k))
3774 IF (branch .LT. 2)
THEN 3775 IF (branch .LT. 1)
THEN 3784 ubib(k) = ubib(k) + ubmcb
3790 & , u, v, t, pi, dpm, rdpm, piln, rlat, rhoi, ni, ti, nm, dt, alpha, &
3791 & dback, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, ut&
3792 & , vt, tt, taugwx, taugwy, fegw, fepgw, dusrc, dvsrc, dtsrc, tau0x, &
3807 INTEGER,
INTENT(IN) :: i
3809 INTEGER,
INTENT(IN) :: pcols
3811 INTEGER,
INTENT(IN) :: pver
3813 INTEGER,
INTENT(IN) :: kbot
3815 INTEGER,
INTENT(IN) :: ktop
3817 INTEGER,
INTENT(IN) :: pgwv
3819 INTEGER,
INTENT(IN) :: ngwv
3821 INTEGER,
INTENT(IN) :: kldv
3823 INTEGER,
INTENT(IN) :: kldvmn
3825 INTEGER,
INTENT(IN) :: ksrc
3827 INTEGER,
INTENT(IN) :: ksrcmn
3829 REAL :: c(-pgwv:pgwv)
3831 REAL :: u(pcols, pver)
3833 REAL :: v(pcols, pver)
3835 REAL :: t(pcols, pver)
3837 REAL :: pi(pcols, 0:pver)
3839 REAL :: dpm(pcols, pver)
3841 REAL :: rdpm(pcols, pver)
3843 REAL :: piln(pcols, 0:pver)
3846 REAL :: rhoi(0:pver)
3856 REAL :: alpha(0:pver)
3858 REAL :: dback(0:pver)
3870 REAL :: effgw(pcols)
3872 REAL :: tau(-pgwv:pgwv, 0:pver)
3880 REAL :: taugwx(pcols, 0:pver)
3882 REAL :: taugwy(pcols, 0:pver)
3884 REAL :: fegw(pcols, 0:pver)
3886 REAL :: fepgw(pcols, 0:pver)
3929 REAL :: dzm, hscal, tautmp
3952 REAL :: tau_min, cmu_, t_new
3962 IF (k .LE. kbot - 1) tau(l, k) = 0.
3992 IF (k .LE. kbot - 1)
THEN 3994 ubmc = ubi(k) - c(l)
3995 IF (ngwv .GT. 0)
THEN 3997 IF (-15.0 .LT. rlat(i)*180./
pi_gwd .AND. rlat(i)*180./
pi_gwd&
4000 IF (pi(i, k) .LT. 1000.0)
THEN 4001 zfac = (pi(i, k)/1000.0)**3
4005 IF (rlat(i)*180./
pi_gwd .LT. -20.0)
THEN 4011 x1 = effkwvmap*rhoi(k)*ubmc**3/(2.*ni(k))
4012 IF (x1 .GE. 0.)
THEN 4017 IF (tausat .LE.
taumin) tausat = 0.0
4018 IF (ubmc*(ubi(k+1)-c(l)) .LE. 0.0) tausat = 0.0
4019 IF (k .EQ. ktop) tausat = 0.
4021 IF (k .EQ. ktop + 1) tausat = tausat*0.02
4022 IF (k .EQ. ktop + 2) tausat = tausat*0.05
4023 IF (k .EQ. ktop + 3) tausat = tausat*0.10
4024 IF (k .EQ. ktop + 4) tausat = tausat*0.20
4025 IF (k .EQ. ktop + 5) tausat = tausat*0.50
4028 IF (tau_min .GT. tau(l, k+1)) tau_min = tau(l, k+1)
4042 IF (k .LE. kbot)
THEN 4044 ubtl =
mapl_grav*(tau(l, k)-tau(l, k-1))*rdpm(i, k)
4046 utl = sign(ubtl, c(l) - ubi(k))
4051 ttl = (c(l)-ubm(k))*utl/
mapl_cp 4057 IF (k .LE. kbot)
THEN 4058 ut(k) = ubt*xv*effgw(i)
4059 vt(k) = ubt*yv*effgw(i)
4060 tt(k) = tbt*effgw(i)
4071 IF (k .GE. kbot + 1)
THEN 4073 pm = (pi(i, k-1)+pi(i, k))*0.5
4074 CALL get_ti(t_new, t(i, k))
4084 IF (k .LE. kbot)
THEN 4087 fpmx = cmu_*tau(l, k)*xv*effgw(i)
4088 fpmy = cmu_*tau(l, k)*yv*effgw(i)
4089 fe = cmu*cmu_*tau(l, k)*effgw(i)
4090 fpe = c(l)*cmu_*tau(l, k)*effgw(i)
4091 IF (k .EQ. kbot)
THEN 4092 fpml = fpmx*xv + fpmy*yv
4095 IF (k .EQ. ktop)
THEN 4096 fpmt = fpmx*xv + fpmy*yv
4100 taugwx(i, k) = taugwx(i, k) + fpmx
4101 taugwy(i, k) = taugwy(i, k) + fpmy
4102 fegw(i, k) = fegw(i, k) + fe
4103 fepgw(i, k) = fepgw(i, k) + fpe
4107 IF (k .GE. kbot + 1)
THEN 4109 pm = (pi(i, k-1)+pi(i, k))*0.5
4110 CALL get_ti(t_new, t(i, k))
4112 dusrcl = -((fpml-fpmt)/(rhom*zlb)*xv)
4113 dvsrcl = -((fpml-fpmt)/(rhom*zlb)*yv)
4114 dtsrcl = -((fpel-fpet-ubm(k)*(fpml-fpmt))/(rhom*zlb*
mapl_cp))
4116 dusrc(k) = dusrc(k) + dusrcl
4117 dvsrc(k) = dvsrc(k) + dvsrcl
4118 dtsrc(k) = dtsrc(k) + dtsrcl
4124 IF (ngwv .EQ. 0)
THEN 4136 x2 = sqrt(ut(k)**2 + vt(k)**2)
4137 IF (x2 .LT. uhtmax)
THEN 4149 dusrc(k) = dusrc(k)*utfac
4150 dvsrc(k) = dvsrc(k)*utfac
4151 dtsrc(k) = dtsrc(k)*utfac
4157 tau0x = tau(0, kbot)*xv*effgw(i)*utfac
4158 tau0y = tau(0, kbot)*yv*effgw(i)*utfac
4164 SUBROUTINE get_uv_b(uv_out, uv_outb, uv_in, uv_inb)
4166 REAL :: uv_out, uv_in
4167 REAL :: uv_outb, uv_inb
4168 LOGICAL :: src_bypass
4169 IF (src_bypass)
THEN 4170 uv_inb = uv_inb + uv_outb
4172 uv_inb = uv_inb + uv_outb
4175 SUBROUTINE get_uv(uv_out, uv_in)
4177 REAL :: uv_out, uv_in
4178 LOGICAL :: src_bypass
4179 IF (src_bypass)
THEN 4187 REAL :: tanh1, tanh2, effkwvmap_, rlat_
4189 tanh1 = (rlat_*180./
pi_gwd-20.0)/6.0
4190 tanh2 = -((rlat_*180./
pi_gwd+20.0)/6.0)
4193 effkwvmap_ =
fcrit2*
kwvb*(0.5*(1.0+tanh1)+0.5*(1.0+tanh2))
4197 REAL :: effkwvmap_, rlat_, zfac
4201 IF (rlat_*180./
pi_gwd + 20. .GE. 0.)
THEN 4202 abs1 = rlat_*180./
pi_gwd + 20.
4204 abs1 = -(rlat_*180./
pi_gwd+20.)
4206 effkwvmap_ =
fcrit2*
kwvo*zfac*(2.0-0.65*exp(-(abs1/5.)))
4210 REAL :: effkwvmap_, rlat_, zfac
4214 IF (rlat_*180./
pi_gwd + 20. .GE. 0.)
THEN 4215 abs1 = rlat_*180./
pi_gwd + 20.
4217 abs1 = -(rlat_*180./
pi_gwd+20.)
4219 effkwvmap_ =
fcrit2*
kwvo*zfac*(0.7+0.65*exp(-(abs1/5.)))
4225 cmu_ = sign(1.0, cmu)
4227 SUBROUTINE get_ti(t_out, t_in)
4230 LOGICAL :: src_bypass
subroutine gw_drag_prof_bwd(i, pcols, pver, pgwv, ngwv, kbot, ktop, c, u, v, t, pi, dpm, rdpm, piln, rlat, rhoi, ni, ti, nm, dt, alpha, dback, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, taub, ubi, ubib, ubm, xv, xvb, yv, yvb, ut, utb, vt, vtb, tt, taugwx, taugwy, fegw, fepgw, dusrc, dvsrc, dtsrc, tau0x, tau0y, effgw)
integer, public isize_s1_tau
subroutine popinteger4(x)
subroutine get_cmu(cmu_, cmu)
real, parameter, public oroko2
subroutine gw_drag_prof_bgnd_b(i, pcols, pver, pgwv, ngwv, kbot, ktop, c, u, v, t, pi, dpm, rdpm, piln, rlat, rhoi, ni, ti, nm, dt, alpha, dback, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, taub, ubi, ubib, ubm, xv, xvb, yv, yvb, ut, utb, vt, vtb, tt, taugwx, taugwy, fegw, fepgw, dusrc, dusrcb, dvsrc, dvsrcb, dtsrc, tau0x, tau0y, effgw)
subroutine get_effkwvmap_2(effkwvmap_, rlat_, zfac)
real *8, parameter, public p_src
real, parameter, public umcfac
subroutine gw_bgnd_fwd(i, pcols, pver, c, u, v, t, pm, pi, dpm, rdpm, piln, rlat, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, ngwv, kbot)
real, parameter, public fcrit2
real, parameter, public orohmin
subroutine gw_oro_bwd(i, pcols, pver, pgwv, u, ub, v, vb, t, sgh, pm, pi, dpm, zm, nm, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, taub, ubi, ubib, ubm, ubmb, xv, xvb, yv, yvb, kbot, rlat)
subroutine gw_oro_fwd(i, pcols, pver, pgwv, u, v, t, sgh, pm, pi, dpm, zm, nm, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, kbot, rlat)
subroutine gw_bgnd(i, pcols, pver, c, u, v, t, pm, pi, dpm, rdpm, piln, rlat, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, ngwv, kbot)
real, parameter, public mapl_cp
real, parameter, public mapl_vireps
real, parameter, public rog
real, parameter, public kwvo
real, parameter, public taubgnd
subroutine gw_drag_prof_bgnd(i, pcols, pver, pgwv, ngwv, kbot, ktop, c, u, v, t, pi, dpm, rdpm, piln, rlat, rhoi, ni, ti, nm, dt, alpha, dback, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, ut, vt, tt, taugwx, taugwy, fegw, fepgw, dusrc, dvsrc, dtsrc, tau0x, tau0y, effgw)
integer, public isize_e1_tau
subroutine get_uv_b(uv_out, uv_outb, uv_in, uv_inb)
real, parameter, public fracldv
subroutine, public gw_main_b(pcols, pver, dt, pgwv, effgworo_dev, effgwbkg_dev, pint_dev, t_dev, u_dev, u_devb, v_dev, v_devb, sgh_dev, pref_dev, pmid_dev, pdel_dev, rpdel_dev, lnpint_dev, zm_dev, qvt_dev, rog, mapl_vireps_, rlat_dev)
subroutine gw_prof(i, k, pcols, pver, u, v, t, pm, pi, rhoi, ni, ti, nm)
subroutine get_uv(uv_out, uv_in)
real, parameter, public mapl_kappa
void pushreal4array(float *x, int n)
real, parameter, public taumin
real, parameter, public mapl_p00
integer, public isize_s2_tau
real, parameter, public tauscal
subroutine get_ti(t_out, t_in)
real, parameter, public mxrange
subroutine get_effkwvmap_3(effkwvmap_, rlat_, zfac)
subroutine gw_drag_prof_fwd(i, pcols, pver, pgwv, ngwv, kbot, ktop, c, u, v, t, pi, dpm, rdpm, piln, rlat, rhoi, ni, ti, nm, dt, alpha, dback, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, ut, vt, tt, taugwx, taugwy, fegw, fepgw, dusrc, dvsrc, dtsrc, tau0x, tau0y, effgw)
subroutine gw_oro(i, pcols, pver, pgwv, u, v, t, sgh, pm, pi, dpm, zm, nm, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, kbot, rlat)
real, parameter, public orovmin
real, parameter, public kwvbeq
subroutine gw_intr_fwd(i, pcols, pver, dt, pgwv, effgworo_dev, effgwbkg_dev, pint_dev, t_dev, u_dev, v_dev, sgh_dev, pref_dev, pmid_dev, pdel_dev, rpdel_dev, lnpint_dev, zm_dev, rlat_dev, dudt_gwd_dev, dvdt_gwd_dev, dtdt_gwd_dev, dudt_org_dev, dvdt_org_dev, dtdt_org_dev, taugwdx_dev, taugwdy_dev, tauox_dev, tauoy_dev, feo_dev, taubkgx_dev, taubkgy_dev, taubx_dev, tauby_dev, feb_dev, fepo_dev, fepb_dev, utbsrc_dev, vtbsrc_dev, ttbsrc_dev)
real, parameter, public n2min
integer, public isize_e2_tau
subroutine gw_intr(i, pcols, pver, dt, pgwv, effgworo_dev, effgwbkg_dev, pint_dev, t_dev, u_dev, v_dev, sgh_dev, pref_dev, pmid_dev, pdel_dev, rpdel_dev, lnpint_dev, zm_dev, rlat_dev, dudt_gwd_dev, dvdt_gwd_dev, dtdt_gwd_dev, dudt_org_dev, dvdt_org_dev, dtdt_org_dev, taugwdx_dev, taugwdy_dev, tauox_dev, tauoy_dev, feo_dev, taubkgx_dev, taubkgy_dev, taubx_dev, tauby_dev, feb_dev, fepo_dev, fepb_dev, utbsrc_dev, vtbsrc_dev, ttbsrc_dev)
real, parameter, public mapl_rgas
real, parameter, public ubmc2mn
logical, parameter, public bypass_bgnd
real, parameter, public mapl_grav
subroutine gw_drag_prof(i, pcols, pver, pgwv, ngwv, kbot, ktop, c, u, v, t, pi, dpm, rdpm, piln, rlat, rhoi, ni, ti, nm, dt, alpha, dback, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubm, xv, yv, ut, vt, tt, taugwx, taugwy, fegw, fepgw, dusrc, dvsrc, dtsrc, tau0x, tau0y, effgw)
real, parameter, public mxasym
subroutine gw_bgnd_bwd(i, pcols, pver, c, u, ub, v, vb, t, pm, pi, dpm, rdpm, piln, rlat, kldv, kldvmn, ksrc, ksrcmn, rdpldv, tau, ubi, ubib, ubm, ubmb, xv, xvb, yv, yvb, ngwv, kbot)
real, parameter, public tndmax
logical, parameter, public bypass_oro
real, parameter, public zldvcon
subroutine gw_intr_bwd(i, pcols, pver, dt, pgwv, effgworo_dev, effgwbkg_dev, pint_dev, t_dev, u_dev, u_devb, v_dev, v_devb, sgh_dev, pref_dev, pmid_dev, pdel_dev, rpdel_dev, lnpint_dev, zm_dev, rlat_dev, dudt_gwd_dev, dudt_gwd_devb, dvdt_gwd_dev, dvdt_gwd_devb, dtdt_gwd_dev, dudt_org_dev, dvdt_org_dev, dtdt_org_dev, taugwdx_dev, taugwdy_dev, tauox_dev, tauoy_dev, feo_dev, taubkgx_dev, taubkgy_dev, taubx_dev, tauby_dev, feb_dev, fepo_dev, fepb_dev, utbsrc_dev, vtbsrc_dev, ttbsrc_dev)
real, parameter, public kwvb
void popreal4array(float *x, int n)
real, parameter, public pi_gwd
subroutine pushinteger4(x)
subroutine get_effkwvmap_1(effkwvmap_, rlat_)