1 !LWRF:MODEL_LAYER:PHYSICS
7 !-------------------------------------------------------------------
8 SUBROUTINE BL_GFS(U3D,V3D,TH3D,T3D,QV3D,QC3D,QI3D,P3D,PI3D, &
9 RUBLTEN,RVBLTEN,RTHBLTEN, &
10 RQVBLTEN,RQCBLTEN,RQIBLTEN, &
11 CP,G,ROVCP,R,ROVG,P_QI,P_FIRST_SCALAR, &
14 HFX,QFX,TSK,GZ1OZ0,WSPD,BR, &
15 DT,KPBL2D,EP1,KARMAN, &
21 HPBL2D, EVAP2D, HEAT2D, & !Kwon add FOR SHAL. CON.
22 VAR_RIC, & !Kwon for variable Ric
23 U10,V10,ZNT,MZNT,rc2d, & !Kwon for variable Ric
24 DKU3D,DKT3D,coef_ric_l,coef_ric_s,xland, & !Kwon for variable Ric
25 msang,scurx,scury,iwavecpl,lcurr_sf, &
26 pert_pbl, ens_random_seed, ens_pblamp, &
28 ids,ide, jds,jde, kds,kde, &
29 ims,ime, jms,jme, kms,kme, &
30 its,ite, jts,jte, kts,kte )
31 !--------------------------------------------------------------------
32 USE MODULE_GFS_MACHINE , ONLY : kind_phys
33 !-------------------------------------------------------------------
35 !-------------------------------------------------------------------
36 !-- U3D 3D u-velocity interpolated to theta points (m/s)
37 !-- V3D 3D v-velocity interpolated to theta points (m/s)
38 !-- TH3D 3D potential temperature (K)
39 !-- T3D temperature (K)
40 !-- QV3D 3D water vapor mixing ratio (Kg/Kg)
41 !-- QC3D 3D cloud mixing ratio (Kg/Kg)
42 !-- QI3D 3D ice mixing ratio (Kg/Kg)
43 !-- P3D 3D pressure (Pa)
44 !-- PI3D 3D exner function (dimensionless)
45 !-- rr3D 3D dry air density (kg/m^3)
46 !-- RUBLTEN U tendency due to
47 ! PBL parameterization (m/s^2)
48 !-- RVBLTEN V tendency due to
49 ! PBL parameterization (m/s^2)
50 !-- RTHBLTEN Theta tendency due to
51 ! PBL parameterization (K/s)
52 !-- RQVBLTEN Qv tendency due to
53 ! PBL parameterization (kg/kg/s)
54 !-- RQCBLTEN Qc tendency due to
55 ! PBL parameterization (kg/kg/s)
56 !-- RQIBLTEN Qi tendency due to
57 ! PBL parameterization (kg/kg/s)
58 !-- CP heat capacity at constant pressure for dry air (J/kg/K)
59 !-- G acceleration due to gravity (m/s^2)
61 !-- R gas constant for dry air (J/kg/K)
63 !-- P_QI species index for cloud ice
64 !-- dz8w dz between full levels (m)
65 !-- z height above sea level (m)
66 !-- PSFC pressure at the surface (Pa)
67 !-- UST u* in similarity theory (m/s)
68 !-- PBL PBL height (m)
69 !-- PSIM similarity stability function for momentum
70 !-- PSIH similarity stability function for heat
71 !-- HFX upward heat flux at the surface (W/m^2)
72 !-- QFX upward moisture flux at the surface (kg/m^2/s)
73 !-- TSK surface temperature (K)
74 !-- GZ1OZ0 log(z/z0) where z0 is roughness length
75 !-- WSPD wind speed at lowest model level (m/s)
76 !-- BR bulk Richardson number in surface layer
78 !-- rvovrd R_v divided by R_d (dimensionless)
79 !-- EP1 constant for virtual temperature (R_v/R_d - 1) (dimensionless)
80 !-- KARMAN Von Karman constant
81 !-- ALPHA boundary depth scaling factor
82 !-- VAR_RIC Flag for using variable Ric or not (=1: variable Ric, =0: constant Ric)
83 !-- RO Surface Rossby number
84 !-- ids start index for i in domain
85 !-- ide end index for i in domain
86 !-- jds start index for j in domain
87 !-- jde end index for j in domain
88 !-- kds start index for k in domain
89 !-- kde end index for k in domain
90 !-- ims start index for i in memory
91 !-- ime end index for i in memory
92 !-- jms start index for j in memory
93 !-- jme end index for j in memory
94 !-- kms start index for k in memory
95 !-- kme end index for k in memory
96 !-- its start index for i in tile
97 !-- ite end index for i in tile
98 !-- jts start index for j in tile
99 !-- jte end index for j in tile
100 !-- kts start index for k in tile
101 !-- kte end index for k in tile
102 !-------------------------------------------------------------------
105 LOGICAL , INTENT(IN):: DISHEAT ! gopal's doing
109 INTEGER , INTENT(IN) :: iwavecpl
110 LOGICAL , INTENT(IN) :: lcurr_sf
111 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: &
112 HPBL2D, & !ADDED BY KWON FOR SHALLOW CONV.
113 EVAP2D, & !ADDED BY KWON FOR SHALLOW CONV.
114 HEAT2D,RC2D,MZNT !ADDED BY KWON FOR SHALLOW CONV.
115 REAL, DIMENSION(ims:ime, jms:jme), INTENT(IN) :: &
116 U10, & !ADDED BY KWON FOR VARIABLE Ric
117 V10,XLAND, & !ADDED BY KWON FOR VARIABLE Ric
118 ZNT !ADDED BY KWON FOR VARIABLE Ric
119 REAL, DIMENSION(ims:ime, jms:jme, kms:kme), INTENT(OUT) :: DKU3D,DKT3D
120 REAL, INTENT(IN) :: VAR_RIC,coef_ric_l,coef_ric_s !ADDED BY KWON
121 REAL, DIMENSION(ims:ime, jms:jme), INTENT(IN) :: &
125 integer,intent(in) :: ens_random_seed
126 real,intent(in) :: ens_pblamp
127 logical,intent(in) :: pert_pbl
132 INTEGER, INTENT(IN) :: ids,ide, jds,jde, kds,kde, &
133 ims,ime, jms,jme, kms,kme, &
134 its,ite, jts,jte, kts,kte, &
137 REAL, INTENT(IN) :: &
147 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN) :: &
161 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: &
169 REAL, DIMENSION(ims:ime, jms:jme), INTENT(IN) :: &
179 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: &
184 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: &
188 !--------------------------- LOCAL VARS ------------------------------
191 REAL (kind=kind_phys), DIMENSION(its:ite, kts:kte) :: &
202 dku,dkt, & !Kwon for diffusivity
207 REAL (kind=kind_phys), DIMENSION(its:ite, kts:kte+1) :: &
211 REAL (kind=kind_phys), DIMENSION(its:ite, kts:kte, 3) :: &
215 REAL (kind=kind_phys), DIMENSION(its:ite) :: &
234 RO,rbcr, & !Kwon for variablr Ric(surface Rossby number)
237 REAL (kind=kind_phys) :: &
247 REAL, PARAMETER:: ALPHA=1.0
251 REAL :: UBOT, VBOT, UBOT1, VBOT1
253 INTEGER, DIMENSION( its:ite ) :: &
274 IF (P_QI.ge.P_FIRST_SCALAR) NTRAC=3
280 RRHOX=(R*T3D(I,KTS,J)*(1.+EP1*QV3D(I,KTS,J)))/PSFC(I,J)
281 CPM=CP*(1.+0.8*QV3D(i,kts,j))
282 FMTMP=GZ1OZ0(i,j)-PSIM(i,j)
283 PSK(i)=(PSFC(i,j)*.00001)**ROVCP
285 FH(i)=GZ1OZ0(i,j)-PSIH(i,j)
287 QSS(i)=QV3D(i,kts,j) ! not used in moninp so set to qv3d for now
288 HEAT(i)=HFX(i,j)/CPM*RRHOX
289 EVAP(i)=QFX(i,j)*RRHOX
292 ! Kwon FOR NEW SHALLOW CONVECTION
293 HEAT2D(i,j)=HFX(i,j)/CPM*RRHOX
294 EVAP2D(i,j)=QFX(i,j)*RRHOX
295 XLAND1(i) = XLAND(I,J)
299 IF ( XLAND(I,J) > 1.99 ) THEN
301 UBOT = U3D(I,KTS,J)-SCURX(I,J)
302 VBOT = V3D(I,KTS,J)-SCURY(I,J)
307 IF ( IWAVECPL .eq. 1 ) THEN
308 UBOT1 = ( UBOT * COS(MSANG(I,J)) - &
309 VBOT * SIN(MSANG(I,J)) ) &
311 VBOT1 = ( VBOT * COS(MSANG(I,J)) - &
312 UBOT * SIN(MSANG(I,J)) ) &
315 WSPD(i,j) = SQRT(UBOT1*UBOT1+VBOT1*VBOT1) + 1.E-9
317 WSPD(i,j) = SQRT(UBOT*UBOT+VBOT*VBOT) + 1.E-9
321 STRESS(i)=KARMAN*KARMAN*WSPD(i,j)*WSPD(i,j)/(FMTMP*FMTMP)
323 PRSI(i,kts)=PSFC(i,j)*.001
328 ! Kwon for variable Ric : Ro=W10/(f*zo): surface Rossby number
329 Ro(I)=SQRT(U10(I,J)**2 + V10(I,J)**2) / (1.E-4 * MZNT(I,J))
339 IF ( XLAND(I,J) > 1.99 .AND. k == KTS ) THEN
341 UBOT = U3D(i,k,j) - SCURX(I,J)
342 VBOT = V3D(i,k,j) - SCURY(I,J)
347 IF ( IWAVECPL .eq. 1 ) THEN
348 U1(I,K) = ( UBOT * COS(MSANG(I,J)) - &
349 VBOT * SIN(MSANG(I,J)) ) &
351 V1(I,K) = ( VBOT * COS(MSANG(I,J)) - &
352 UBOT * SIN(MSANG(I,J)) ) &
367 Q1(I,K,1) = QV3D(i,k,j)/(1.+QV3D(i,k,j))
368 Q1(I,K,2) = QC3D(i,k,j)/(1.+QC3D(i,k,j))
369 PRSL(I,K)=P3D(i,k,j)*.001
375 PRSLK(I,K)=(PRSL(i,k)*.01)**ROVCP
383 DEL(i,km)=PRSL(i,km)/ROVG*dz8w(i,km,j)/T3D(i,km,j)
384 PRSI(i,k)=PRSI(i,km)-DEL(i,km)
385 PHII(I,K)=(Z(i,k,j)-Z(i,kts,j))*G
386 PHIL(I,KM)=0.5*(Z(i,k,j)+Z(i,km,j)-2.*Z(i,kts,j))*G
391 DEL(i,kte)=DEL(i,ktem)
392 PRSI(i,ktep)=PRSI(i,kte)-DEL(i,ktem)
393 PHII(I,KTEP)=PHII(I,KTE)+dz8w(i,kte,j)*G
394 PHIL(I,KTE)=PHII(I,KTE)-PHIL(I,KTEM)+PHII(I,KTE)
397 IF (P_QI.ge.P_FIRST_SCALAR) THEN
400 Q1(I,K,3) = QI3D(i,k,j)/(1.+QI3D(i,k,j))
413 CALL MONINP(IM,IM,KX,NTRAC,DV,DU,TAU,RTG,U1,V1,T1,Q1, &
414 PSK,RBSOIL,FM,FH,TSEA,QSS,HEAT,EVAP,STRESS, &
415 SPD1,KPBL,PRSI,DEL,PRSL,PRSLK,PHII,PHIL,RCL, &
416 DELTIM,DUSFC,DVSFC,DTSFC,DQSFC,HPBL,HGAMT, &
418 VAR_RIC,Ro,DKU,DKT,coef_ric_l,coef_ric_s,xland1, &
419 pert_pbl, ens_random_seed, ens_pblamp, &
423 !============================================================================
424 ! ADD IN DISSIPATIVE HEATING .... v*dv. This is Bob's doing
425 !============================================================================
432 dishx(i,k)=u1(i,k)*du(i,k) + v1(i,k)*dv(i,k)
433 cpmikj=CP*(1.+0.8*QV3D(i,k,j))
434 dishx(i,k)=-dishx(i,k)/cpmikj
435 ! IF(k==1)WRITE(0,*)'ADDITIONAL DISSIPATIVE HEATING',tau(i,k),dishx(i,k)
436 tau(i,k)=tau(i,k)+dishx(i,k)
442 !=============================================================================
447 RVBLTEN(I,K,J)=DV(I,K)
448 RUBLTEN(I,K,J)=DU(I,K)
449 RTHBLTEN(I,K,J)=TAU(I,K)/PI3D(I,K,J)
450 RQVBLTEN(I,K,J)=RTG(I,K,1)/(1.-Q1(I,K,1))**2
451 RQCBLTEN(I,K,J)=RTG(I,K,2)/(1.-Q1(I,K,2))**2
455 IF (P_QI.ge.P_FIRST_SCALAR) THEN
458 RQIBLTEN(I,K,J)=RTG(I,K,3)/(1.-Q1(I,K,3))**2
464 UST(i,j)=SQRT(STRESS(i))
465 WSPD(i,j)=SQRT(U3D(I,KTS,J)*U3D(I,KTS,J)+ &
466 V3D(I,KTS,J)*V3D(I,KTS,J))+1.E-9
469 !Kwon For new shallow convection
476 ! INITIALIZE DKU3D and DKT3D (3D momentum and thermal diffusivity for
489 DKU3D(I,J,K) = DKU(I,K)
490 DKT3D(I,J,K) = DKT(I,K)
498 END SUBROUTINE BL_GFS
500 !===================================================================
501 SUBROUTINE gfsinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
502 RQCBLTEN,RQIBLTEN,P_QI,P_FIRST_SCALAR, &
505 ids, ide, jds, jde, kds, kde, &
506 ims, ime, jms, jme, kms, kme, &
507 its, ite, jts, jte, kts, kte )
508 !-------------------------------------------------------------------
510 !-------------------------------------------------------------------
511 LOGICAL , INTENT(IN) :: allowed_to_read,restart
512 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
513 ims, ime, jms, jme, kms, kme, &
514 its, ite, jts, jte, kts, kte
515 INTEGER , INTENT(IN) :: P_QI,P_FIRST_SCALAR
517 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: &
524 INTEGER :: i, j, k, itf, jtf, ktf
544 IF (P_QI .ge. P_FIRST_SCALAR .and. .not.restart) THEN
554 IF (P_QI .ge. P_FIRST_SCALAR) THEN
565 END SUBROUTINE gfsinit
567 ! --------------------------------------------------------------
569 SUBROUTINE MONINP(IX,IM,KM,ntrac,DV,DU,TAU,RTG, &
571 & PSK,RBSOIL,FM,FH,TSEA,QSS,HEAT,EVAP,STRESS,SPD1,KPBL, &
572 & PRSI,DEL,PRSL,PRSLK,PHII,PHIL,RCL,DELTIM, &
573 & DUSFC,DVSFC,DTSFC,DQSFC,HPBL,HGAMT, &
575 VAR_RIC,Ro,DKU,DKT,coef_ric_l,coef_ric_s,xland1, &
576 pert_pbl, ens_random_seed, ens_pblamp, &
580 USE MODULE_GFS_MACHINE, ONLY : kind_phys
581 USE MODULE_GFS_PHYSCONS, grav => con_g, RD => con_RD, CP => con_CP &
582 &, HVAP => con_HVAP, ROG => con_ROG, FV => con_FVirt
586 ! include 'constant.h'
591 integer IX, IM, KM, ntrac, KPBL(IM)
593 real(kind=kind_phys) DELTIM
597 real :: VAR_RIC,coef_ric_l,coef_ric_s
598 integer,intent(in) :: ens_random_seed
599 real,intent(in) :: ens_pblamp
600 logical,intent(in) :: pert_pbl
602 real(kind=kind_phys) DV(IM,KM), DU(IM,KM), &
603 & TAU(IM,KM), RTG(IM,KM,ntrac), &
604 & U1(IX,KM), V1(IX,KM), &
605 & T1(IX,KM), Q1(IX,KM,ntrac), &
606 & PSK(IM), RBSOIL(IM), &
607 ! & CD(IM), CH(IM), &
609 & TSEA(IM), QSS(IM), &
611 ! & DPHI(IM), SPD1(IM), &
612 & PRSI(IX,KM+1), DEL(IX,KM), &
613 & PRSL(IX,KM), PRSLK(IX,KM), &
614 & PHII(IX,KM+1), PHIL(IX,KM), &
615 & RCL(IM), DUSFC(IM), &
616 & dvsfc(IM), dtsfc(IM), &
617 & DQSFC(IM), HPBL(IM), &
618 & HGAMT(IM), hgamq(IM), RBCR(IM)
620 real(kind=kind_phys) RO(IM),xland1(IM)
625 integer i,iprt,is,iun,k,kk,kmpbl,lond
626 ! real(kind=kind_phys) betaq(IM), betat(IM), betaw(IM), &
627 real(kind=kind_phys) evap(IM), heat(IM), phih(IM), &
628 & phim(IM), rbdn(IM), rbup(IM), &
629 & the1(IM), stress(im), beta(im), &
630 & the1v(IM), thekv(IM), thermal(IM), &
631 & thesv(IM), ustar(IM), wscale(IM)
632 ! & thesv(IM), ustar(IM), wscale(IM), zl1(IM)
634 real(kind=kind_phys) RDZT(IM,KM-1), &
635 & ZI(IM,KM+1), ZL(IM,KM), &
637 & AL(IM,KM-1), AD(IM,KM), &
638 & AU(IM,KM-1), A1(IM,KM), &
639 & A2(IM,KM), THETA(IM,KM), &
640 & AT(IM,KM*(ntrac-1)),DKU(IM,KM-1),DKT(IM,KM-1),WSPM(IM,KM-1) ! RGF added WSPM
641 logical pblflg(IM), sfcflg(IM), stable(IM)
643 real(kind=kind_phys) aphi16, aphi5, bet1, bvf2, &
644 & cfac, conq, cont, conw, &
645 & conwrc, dk, dkmax, dkmin, &
646 & dq1, dsdz2, dsdzq, dsdzt, &
647 & dsig, dt, dthe1, dtodsd, &
648 & dtodsu, dw2, dw2min, g, &
649 & gamcrq, gamcrt, gocp, gor, gravi, &
650 & hol, pfac, prmax, prmin, prinv, &
651 & prnum, qmin, qtend, &
652 & rbint, rdt, rdz, rdzt1, &
653 & ri, rimin, rl2, rlam, &
654 & rone, rzero, sfcfrac, &
655 & sflux, shr2, spdk2, sri, &
656 & tem, ti, ttend, tvd, &
657 & tvu, utend, vk, vk2, &
658 & vpert, vtend, xkzo, zfac, &
664 PARAMETER(GOR=G/RD,GOCP=G/CP)
665 PARAMETER(CONT=1000.*CP/G,CONQ=1000.*HVAP/G,CONW=1000./G)
666 PARAMETER(RLAM=150.,VK=0.4,VK2=VK*VK,PRMIN=1.0,PRMAX=4.)
667 PARAMETER(DW2MIN=0.0001,DKMIN=1.0,DKMAX=1000.,RIMIN=-100.)
668 PARAMETER(CFAC=7.8,PFAC=2.0,SFCFRAC=0.1)
669 PARAMETER(QMIN=1.E-8,XKZO=1.0,ZFMIN=1.E-8,APHI5=5.,APHI16=16.)
670 ! PARAMETER(GAMCRT=3.,GAMCRQ=2.E-3)
671 PARAMETER(GAMCRT=3.,GAMCRQ=0.)
672 PARAMETER(RZERO=0.,RONE=1.)
675 real*8 :: ran1 !zhang
677 logical,save :: pert_pbl_local !zhang
678 integer,save :: ens_random_seed_local !zhang
679 real,save :: ens_pblamp_local !zhang
680 data ens_random_seed_local/0/
681 !zz print*, 'zhang in pbl==========='
682 if ( ens_random_seed_local .eq. 0 ) then
683 pert_pbl_local=pert_pbl
684 ens_random_seed_local=ens_random_seed
685 ens_pblamp_local=ens_pblamp
686 !zz print*, "zhang in pbl= one time ", pert_pbl_local, ens_random_seed_local, ens_pblamp_local
688 !zz print*, "zhang in pbl=",pert_pbl_local, ens_random_seed_local, ens_pblamp_local
692 !-----------------------------------------------------------------------
694 601 FORMAT(1X,' MONINP LAT LON STEP HOUR ',3I6,F6.1)
695 602 FORMAT(1X,' K',' Z',' T',' TH', &
696 & ' TVH',' Q',' U',' V', &
698 603 FORMAT(1X,I5,8F9.1)
699 604 FORMAT(1X,' SFC',9X,F9.1,18X,F9.1)
700 605 FORMAT(1X,' K ZL SPD2 THEKV THE1V' &
702 606 FORMAT(1X,I5,6F8.2)
703 607 FORMAT(1X,' KPBL HPBL FM FH HGAMT', &
704 & ' HGAMQ WS USTAR CD CH')
705 608 FORMAT(1X,I5,9F8.2)
706 609 FORMAT(1X,' K PR DKT DKU ',I5,3F8.2)
707 610 FORMAT(1X,' K PR DKT DKU ',I5,3F8.2,' L2 RI T2', &
708 & ' SR2 ',2F8.2,2E10.2)
709 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
710 ! COMPUTE PRELIMINARY VARIABLES
724 ! define critical Richardson number by KWON: Vickers and Mahart(2004) J. Appl. Meteo.
725 ! coef_ric=0.16 originally but it may too small: controled by namelist=0.25
726 ! Land and Ocean points are treated differently
732 IF(var_ric.eq.1.) THEN
733 IF(xland1(i).eq.1) RBCR(I) = coef_ric_l*(1.E-7*Ro(I))**(-0.18)
734 IF(xland1(i).eq.2) RBCR(I) = coef_ric_s*(1.E-7*Ro(I))**(-0.18)
735 ! write(0,*) 'xland1 coef_ric_l coef_ric_s ',xland1(i),coef_ric_l,coef_ric_s
737 IF(RBCR(I).GT.0.5) RBCR(I)=0.5 !set upper limit Suggsted by Han
748 zi(i,k) = phii(i,k) * gravi
749 zl(i,k) = phil(i,k) * gravi
755 theta(i,k) = t1(i,k) * psk(i) / prslk(i,k)
761 RDZT(I,K) = GOR * PRSI(I,K+1) / (PRSL(I,K) - PRSL(I,K+1))
777 IF(RBSOIL(I).GT.0.0) SFCFLG(I) = .FALSE.
781 RDZT1 = GOR * prSL(i,1) / DEL(i,1)
782 ! BET1 = DT*RDZT1*SPD1(I)/T1(I,1)
783 BETA(I) = DT*RDZT1/T1(I,1)
784 ! BETAW(I) = BET1*CD(I)
785 ! BETAT(I) = BET1*CH(I)
786 ! BETAQ(I) = DPHI(I)*BETAT(I)
790 ! ZL1(i) = 0.-(T1(I,1)+TSEA(I))/2.*LOG(PRSL(I,1)/PRSI(I,1))*ROG
791 ! USTAR(I) = SQRT(CD(I)*SPD1(I)**2)
792 USTAR(I) = SQRT(STRESS(I))
796 THESV(I) = TSEA(I)*(1.+FV*MAX(QSS(I),QMIN))
798 THE1V(I) = THE1(I)*(1.+FV*MAX(Q1(I,1,1),QMIN))
799 THERMAL(I) = THE1V(I)
800 ! DTHE1 = (THE1(I)-TSEA(I))
801 ! DQ1 = (MAX(Q1(I,1,1),QMIN) - MAX(QSS(I),QMIN))
802 ! HEAT(I) = -CH(I)*SPD1(I)*DTHE1
803 ! EVAP(I) = -CH(I)*SPD1(I)*DQ1
807 ! COMPUTE THE FIRST GUESS OF PBL HEIGHT
816 IF(.NOT.STABLE(I)) THEN
818 ! ZL(I,k) = ZL(I,K-1) - (T1(i,k)+T1(i,K-1))/2 *
819 ! & LOG(PRSL(I,K)/PRSL(I,K-1)) * ROG
820 THEKV(I) = THETA(i,k)*(1.+FV*MAX(Q1(i,k,1),QMIN))
821 SPDK2 = MAX(RCL(i)*(U1(i,k)*U1(i,k)+V1(i,k)*V1(i,k)),RONE)
822 RBUP(I) = (THEKV(I)-THE1V(I))*(G*ZL(I,k)/THE1V(I))/SPDK2
824 STABLE(I) = RBUP(I).GT.RBCR(I)
831 IF(RBDN(I).GE.RBCR(I)) THEN
833 ELSEIF(RBUP(I).LE.RBCR(I)) THEN
836 RBINT = (RBCR(I)-RBDN(I))/(RBUP(I)-RBDN(I))
838 HPBL(I) = ZL(I,K-1) + RBINT*(ZL(I,K)-ZL(I,K-1))
839 IF(HPBL(I).LT.ZI(I,KPBL(I))) KPBL(I) = KPBL(I) - 1
843 HOL = MAX(RBSOIL(I)*FM(I)*FM(I)/FH(I),RIMIN)
845 HOL = MIN(HOL,-ZFMIN)
850 ! HOL = HOL*HPBL(I)/ZL1(I)*SFCFRAC
851 HOL = HOL*HPBL(I)/ZL(I,1)*SFCFRAC
853 ! PHIM = (1.-APHI16*HOL)**(-1./4.)
854 ! PHIH = (1.-APHI16*HOL)**(-1./2.)
855 TEM = 1.0 / (1. - APHI16*HOL)
857 PHIM(I) = SQRT(PHIH(I))
859 PHIM(I) = (1.+APHI5*HOL)
862 WSCALE(I) = USTAR(I)/PHIM(I)
863 WSCALE(I) = MIN(WSCALE(I),USTAR(I)*APHI16)
864 WSCALE(I) = MAX(WSCALE(I),USTAR(I)/APHI5)
867 ! COMPUTE THE SURFACE VARIABLES FOR PBL HEIGHT ESTIMATION
868 ! UNDER UNSTABLE CONDITIONS
871 SFLUX = HEAT(I) + EVAP(I)*FV*THE1(I)
872 IF(SFCFLG(I).AND.SFLUX.GT.0.0) THEN
873 HGAMT(I) = MIN(CFAC*HEAT(I)/WSCALE(I),GAMCRT)
874 HGAMQ(I) = MIN(CFAC*EVAP(I)/WSCALE(I),GAMCRQ)
875 VPERT = HGAMT(I) + FV*THE1(I)*HGAMQ(I)
876 VPERT = MIN(VPERT,GAMCRT)
877 THERMAL(I) = THERMAL(I) + MAX(VPERT,RZERO)
878 HGAMT(I) = MAX(HGAMT(I),RZERO)
879 HGAMQ(I) = MAX(HGAMQ(I),RZERO)
892 ! ENHANCE THE PBL HEIGHT BY CONSIDERING THE THERMAL
902 IF(.NOT.STABLE(I).AND.PBLFLG(I)) THEN
904 ! ZL(I,k) = ZL(I,K-1) - (T1(i,k)+T1(i,K-1))/2 *
905 ! & LOG(PRSL(I,K)/PRSL(I,K-1)) * ROG
906 THEKV(I) = THETA(i,k)*(1.+FV*MAX(Q1(i,k,1),QMIN))
907 SPDK2 = MAX(RCL(i)*(U1(i,k)*U1(i,k)+V1(i,k)*V1(i,k)),RONE)
908 RBUP(I) = (THEKV(I)-THERMAL(I))*(G*ZL(I,k)/THE1V(I))/SPDK2
910 STABLE(I) = RBUP(I).GT.RBCR(I)
918 IF(RBDN(I).GE.RBCR(I)) THEN
920 ELSEIF(RBUP(I).LE.RBCR(I)) THEN
923 RBINT = (RBCR(I)-RBDN(I))/(RBUP(I)-RBDN(I))
925 HPBL(I) = ZL(I,K-1) + RBINT*(ZL(I,k)-ZL(I,K-1))
927 !zhang adding PBL perturtion
928 if ( pert_pbl_local ) then
929 rr=(2.0*ens_pblamp_local*ran1(ens_random_seed_local)-ens_pblamp_local)
930 print*, "zhang inside the loop", rr, ens_pblamp_local,ens_random_seed_local
931 HPBL(I) = HPBL(I)*(1.0+rr)
934 IF(HPBL(I).LT.ZI(I,KPBL(I))) KPBL(I) = KPBL(I) - 1
935 IF(KPBL(I).LE.1) PBLFLG(I) = .FALSE.
940 ! COMPUTE DIFFUSION COEFFICIENTS BELOW PBL
944 ! -------------------------------------------------------------------------------------
945 ! begin RGF modifications
946 ! this is version MOD05
949 ! RGF determine wspd at roughly 500 m above surface, or as close as possible, reuse SPDK2
950 ! zi(i,k) is AGL, right? May not matter if applied only to water grid points
956 DO K = 1, KMPBL ! kmpbl is like a max possible pbl height
957 if(zi(i,k).le.500.and.zi(i,k+1).gt.500.)then ! find level bracketing 500 m
958 SPDK2 = SQRT(U1(i,k)*U1(i,k)+V1(i,k)*V1(i,k)) ! wspd near 500 m
959 WSPM(i,1) = SPDK2/0.6 ! now the Km limit for 500 m. just store in K=1
960 WSPM(i,2) = float(k) ! height of level at gridpoint i. store in K=2
961 ! if(i.eq.25) print *,' IK ',i,k,' ZI ',zi(i,k), ' WSPM1 ',wspm(i,1),' KMPBL ',kmpbl,' KPBL ',kpbl(i)
970 DO I=1,IM ! RGF SWAPPED ORDER. TESTED - NO IMPACT
975 ! First guess at DKU. If alpha >= 0, this is the only loop executed
977 IF(KPBL(I).GT.K) THEN ! first guess DKU, this is original loop
978 PRINV = 1.0 / (PHIH(I)/PHIM(I)+CFAC*VK*.1)
979 PRINV = MIN(PRINV,PRMAX)
980 PRINV = MAX(PRINV,PRMIN)
981 ! ZFAC = MAX((1.-(ZI(I,K+1)-ZL1(I))/ &
982 ! & (HPBL(I)-ZL1(I))), ZFMIN)
983 ZFAC = MAX((1.-(ZI(I,K+1)-ZL(I,1))/ &
984 & (HPBL(I)-ZL(I,1))), ZFMIN)
986 ! alpha factor (0-1.0) is multiplied to profile function to reduce the effect
987 ! height of the Hurricane Boundary Layer. This is gopal's doing
991 DKU(i,k) = XKZO + WSCALE(I)*VK*ZI(I,K+1) &
992 & *ABS(ALPHA)* ZFAC**PFAC
993 ! if alpha = -1, the above provides the first guess for DKU, based on assumption alpha = +1
994 ! (other values of alpha < 0 can also be applied)
995 ! if alpha > 0, the above applies the alpha suppression factor and we are finished
996 ! if(i.eq.25) print *,' I25 K ',k,' ORIG DKU ',dku(i,k)
997 DKT(i,k) = DKU(i,k)*PRINV
998 DKO(i,k) = (DKU(i,k)-XKZO)*PRINV
999 DKU(i,k) = MIN(DKU(i,k),DKMAX)
1000 DKU(i,k) = MAX(DKU(i,k),DKMIN)
1001 DKT(i,k) = MIN(DKT(i,k),DKMAX)
1002 DKT(i,k) = MAX(DKT(i,k),DKMIN)
1003 DKO(i,k) = MAX(RZERO, MIN(DKMAX, DKO(i,k)))
1009 ! possible modification of first guess DKU, under certain conditions
1010 ! (1) this applies only to columns over water
1012 IF(xland1(i).eq.2)then ! sea only
1015 ! if alpha < 0, find alpha for each column and do the loop again
1016 ! if alpha > 0, we are finished
1019 if(alpha.lt.0)then ! variable alpha test
1021 ! k-level of layer around 500 m
1022 kLOC = INT(WSPM(i,2))
1023 ! print *,' kLOC ',kLOC,' KPBL ',KPBL(I)
1025 ! (3) only do this IF KPBL(I) >= kLOC. Otherwise, we are finished, with DKU as if alpha = +1
1027 if(KPBL(I).gt.kLOC)then
1029 xDKU = DKU(i,kLOC) ! Km at k-level
1032 ! WSPM(i,1) is the KM cap for the 500-m level.
1033 ! if DKU at 500-m level < WSPM(i,1), do not limit Km ANYWHERE. Alpha = abs(alpha). No need to recalc.
1034 ! if DKU at 500-m level > WSPM(i,1), then alpha = WSPM(i,1)/xDKU for entire column
1035 if(xDKU.ge.WSPM(i,1)) then ! ONLY if DKU at 500-m exceeds cap, otherwise already done
1038 WSPM(i,3) = WSPM(i,1)/xDKU ! ratio of cap to Km at k-level, store in WSPM(i,3)
1039 WSPM(i,4) = amin1(WSPM(I,3),1.0) ! this is new column alpha. cap at 1. ! should never be needed
1041 ! if(i.eq.25) print *,' I25 kLOC ',kLOC,' xDKU ',xDKU,' WSPM1 ',WSPM(i,1),' WSPM3 ',WSPM(i,3),' WSPM4 ',WSPM(i,4)
1043 DO K = 1, KMPBL ! now go through K loop again
1044 IF(KPBL(I).GT.K) THEN
1045 PRINV = 1.0 / (PHIH(I)/PHIM(I)+CFAC*VK*.1)
1046 PRINV = MIN(PRINV,PRMAX)
1047 PRINV = MAX(PRINV,PRMIN)
1048 ! ZFAC = MAX((1.-(ZI(I,K+1)-ZL1(I))/ &
1049 ! & (HPBL(I)-ZL1(I))), ZFMIN)
1050 ZFAC = MAX((1.-(ZI(I,K+1)-ZL(I,1))/ &
1051 & (HPBL(I)-ZL(I,1))), ZFMIN)
1053 DKU(i,k) = XKZO + WSCALE(I)*VK*ZI(I,K+1) &
1054 & *WSPM(i,4)* ZFAC**PFAC ! recalculated DKU using column alpha
1055 ! if(i.eq.25) print *,' I25 K ',k,' DKU AFTER ',dku(i,k)
1058 DKT(i,k) = DKU(i,k)*PRINV
1059 DKO(i,k) = (DKU(i,k)-XKZO)*PRINV
1060 DKU(i,k) = MIN(DKU(i,k),DKMAX)
1061 DKU(i,k) = MAX(DKU(i,k),DKMIN)
1062 DKT(i,k) = MIN(DKT(i,k),DKMAX)
1063 DKT(i,k) = MAX(DKT(i,k),DKMIN)
1064 DKO(i,k) = MAX(RZERO, MIN(DKMAX, DKO(i,k)))
1066 ENDDO ! DO K (RGF ALTERED)
1067 endif ! xDKU.ge.WSPM(i,1)
1068 endif ! KPBL(I).ge.kLOC
1074 ! end RGF modifications
1075 ! -------------------------------------------------------------------------------------
1078 ! COMPUTE DIFFUSION COEFFICIENTS OVER PBL (FREE ATMOSPHERE)
1082 IF(K.GE.KPBL(I)) THEN
1083 ! TI = 0.5*(T1(i,k)+T1(i,K+1))
1084 TI = 2.0 / (T1(i,k)+T1(i,K+1))
1085 ! RDZ = RDZT(I,K)/TI
1086 RDZ = RDZT(I,K) * TI
1088 DW2 = RCL(i)*((U1(i,k)-U1(i,K+1))**2 &
1089 & + (V1(i,k)-V1(i,K+1))**2)
1090 SHR2 = MAX(DW2,DW2MIN)*RDZ**2
1091 TVD = T1(i,k)*(1.+FV*MAX(Q1(i,k,1),QMIN))
1092 TVU = T1(i,K+1)*(1.+FV*MAX(Q1(i,K+1,1),QMIN))
1093 ! BVF2 = G*(GOCP+RDZ*(TVU-TVD))/TI
1094 BVF2 = G*(GOCP+RDZ*(TVU-TVD)) * TI
1095 RI = MAX(BVF2/SHR2,RIMIN)
1097 ! RL2 = (ZK*RLAM/(RLAM+ZK))**2
1098 ! DK = RL2*SQRT(SHR2)
1099 RL2 = ZK*RLAM/(RLAM+ZK)
1100 DK = RL2*RL2*SQRT(SHR2)
1101 IF(RI.LT.0.) THEN ! UNSTABLE REGIME
1103 DKU(i,k) = XKZO + DK*(1+8.*(-RI)/(1+1.746*SRI))
1104 ! DKT(i,k) = XKZO + DK*(1+8.*(-RI)/(1+1.286*SRI))
1105 tem = DK*(1+8.*(-RI)/(1+1.286*SRI))
1106 DKT(i,k) = XKZO + tem
1108 ELSE ! STABLE REGIME
1109 ! DKT(i,k) = XKZO + DK/(1+5.*RI)**2
1110 tem = DK/(1+5.*RI)**2
1111 DKT(i,k) = XKZO + tem
1113 PRNUM = 1.0 + 2.1*RI
1114 PRNUM = MIN(PRNUM,PRMAX)
1115 DKU(i,k) = (DKT(i,k)-XKZO)*PRNUM + XKZO
1118 DKU(i,k) = MIN(DKU(i,k),DKMAX)
1119 DKU(i,k) = MAX(DKU(i,k),DKMIN)
1120 DKT(i,k) = MIN(DKT(i,k),DKMAX)
1121 DKT(i,k) = MAX(DKT(i,k),DKMIN)
1122 DKO(i,k) = MAX(RZERO, MIN(DKMAX, DKO(i,k)))
1124 !!! IF(I.EQ.LOND.AND.LAT.EQ.LATD) THEN
1125 !!! PRNUM = DKU(k)/DKT(k)
1126 !!! WRITE(IUN,610) K,PRNUM,DKT(k),DKU(k),RL2,RI,
1135 ! COMPUTE TRIDIAGONAL MATRIX ELEMENTS FOR HEAT AND MOISTURE
1139 A1(I,1) = T1(i,1) + BETA(i) * HEAT(I)
1140 A2(I,1) = Q1(i,1,1) + BETA(i) * EVAP(I)
1141 ! A1(I,1) = T1(i,1)-BETAT(I)*(THETA(i,1)-TSEA(I))
1142 ! A2(I,1) = Q1(i,1,1)-BETAQ(I)*
1143 ! & (MAX(Q1(i,1,1),QMIN)-MAX(QSS(I),QMIN))
1148 DTODSD = DT/DEL(I,K)
1149 DTODSU = DT/DEL(I,K+1)
1150 DSIG = PRSL(I,K)-PRSL(I,K+1)
1151 RDZ = RDZT(I,K)*2./(T1(i,k)+T1(i,K+1))
1153 tem1 = DSIG * DKT(i,k) * RDZ
1154 IF(PBLFLG(I).AND.K.LT.KPBL(I)) THEN
1155 ! DSDZT = DSIG*DKT(i,k)*RDZ*(GOCP-HGAMT(I)/HPBL(I))
1156 ! DSDZQ = DSIG*DKT(i,k)*RDZ*(-HGAMQ(I)/HPBL(I))
1158 DSDZT = tem1 * (GOCP-HGAMT(I)*tem)
1159 DSDZQ = tem1 * (-HGAMQ(I)*tem)
1160 A2(I,k) = A2(I,k)+DTODSD*DSDZQ
1161 A2(I,k+1) = Q1(i,k+1,1)-DTODSU*DSDZQ
1163 ! DSDZT = DSIG*DKT(i,k)*RDZ*(GOCP)
1165 A2(I,k+1) = Q1(i,k+1,1)
1167 ! DSDZ2 = DSIG*DKT(i,k)*RDZ*RDZ
1169 AU(I,k) = -DTODSD*DSDZ2
1170 AL(I,k) = -DTODSU*DSDZ2
1171 AD(I,k) = AD(I,k)-AU(I,k)
1172 AD(I,k+1) = 1.-AL(I,k)
1173 A1(I,k) = A1(I,k)+DTODSD*DSDZT
1174 A1(I,k+1) = T1(i,k+1)-DTODSU*DSDZT
1178 ! SOLVE TRIDIAGONAL PROBLEM FOR HEAT AND MOISTURE
1180 CALL TRIDIN(IM,KM,1,AL,AD,AU,A1,A2,AU,A1,A2)
1182 ! RECOVER TENDENCIES OF HEAT AND MOISTURE
1186 TTEND = (A1(I,k)-T1(i,k))*RDT
1187 QTEND = (A2(I,k)-Q1(i,k,1))*RDT
1188 TAU(i,k) = TAU(i,k)+TTEND
1189 RTG(I,k,1) = RTG(i,k,1)+QTEND
1190 DTSFC(I) = DTSFC(I)+CONT*DEL(I,K)*TTEND
1191 DQSFC(I) = DQSFC(I)+CONQ*DEL(I,K)*QTEND
1195 ! COMPUTE TRIDIAGONAL MATRIX ELEMENTS FOR MOMENTUM
1198 ! AD(I,1) = 1.+BETAW(I)
1199 AD(I,1) = 1.0 + BETA(i) * STRESS(I) / SPD1(I)
1203 ! tem = 1.0 + BETA(I) * STRESS(I) / SPD1(I)
1204 ! A1(I,1) = U1(i,1) * tem
1205 ! A2(I,1) = V1(i,1) * tem
1210 DTODSD = DT/DEL(I,K)
1211 DTODSU = DT/DEL(I,K+1)
1212 DSIG = PRSL(I,K)-PRSL(I,K+1)
1213 RDZ = RDZT(I,K)*2./(T1(i,k)+T1(i,k+1))
1215 DSDZ2 = DSIG*DKU(i,k)*RDZ*RDZ
1216 AU(I,k) = -DTODSD*DSDZ2
1217 AL(I,k) = -DTODSU*DSDZ2
1218 AD(I,k) = AD(I,k)-AU(I,k)
1219 AD(I,k+1) = 1.-AL(I,k)
1220 A1(I,k+1) = U1(i,k+1)
1221 A2(I,k+1) = V1(i,k+1)
1225 ! SOLVE TRIDIAGONAL PROBLEM FOR MOMENTUM
1227 CALL TRIDI2(IM,KM,AL,AD,AU,A1,A2,AU,A1,A2)
1229 ! RECOVER TENDENCIES OF MOMENTUM
1233 CONWRC = CONW*SQRT(RCL(i))
1234 UTEND = (A1(I,k)-U1(i,k))*RDT
1235 VTEND = (A2(I,k)-V1(i,k))*RDT
1236 DU(i,k) = DU(i,k)+UTEND
1237 DV(i,k) = DV(i,k)+VTEND
1238 DUSFC(I) = DUSFC(I)+CONWRC*DEL(I,K)*UTEND
1239 DVSFC(I) = DVSFC(I)+CONWRC*DEL(I,K)*VTEND
1244 ! COMPUTE TRIDIAGONAL MATRIX ELEMENTS FOR TRACERS
1246 if (ntrac .ge. 2) then
1253 AT(I,1+is) = Q1(i,1,k)
1259 DTODSD = DT/DEL(I,K)
1260 DTODSU = DT/DEL(I,K+1)
1261 DSIG = PRSL(I,K)-PRSL(I,K+1)
1262 RDZ = RDZT(I,K)*2./(T1(i,k)+T1(i,K+1))
1263 tem1 = DSIG * DKT(i,k) * RDZ
1265 AU(I,k) = -DTODSD*DSDZ2
1266 AL(I,k) = -DTODSU*DSDZ2
1267 AD(I,k) = AD(I,k)-AU(I,k)
1268 AD(I,k+1) = 1.-AL(I,k)
1275 AT(I,k+1+is) = Q1(i,k+1,kk)
1280 ! SOLVE TRIDIAGONAL PROBLEM FOR TRACERS
1282 CALL TRIDIT(IM,KM,ntrac-1,AL,AD,AU,AT,AU,AT)
1284 ! RECOVER TENDENCIES OF TRACERS
1290 QTEND = (AT(I,K+is)-Q1(i,K,kk))*RDT
1291 RTG(i,K,kk) = RTG(i,K,kk) + QTEND
1298 END SUBROUTINE MONINP
1300 !-----------------------------------------------------------------------
1301 SUBROUTINE TRIDI2(L,N,CL,CM,CU,R1,R2,AU,A1,A2)
1302 !sela %INCLUDE DBTRIDI2;
1304 USE MODULE_GFS_MACHINE, ONLY : kind_phys
1307 real(kind=kind_phys) fk
1309 real(kind=kind_phys) CL(L,2:N),CM(L,N),CU(L,N-1),R1(L,N),R2(L,N), &
1310 & AU(L,N-1),A1(L,N),A2(L,N)
1311 !-----------------------------------------------------------------------
1314 AU(I,1) = FK*CU(I,1)
1315 A1(I,1) = FK*R1(I,1)
1316 A2(I,1) = FK*R2(I,1)
1320 FK = 1./(CM(I,K)-CL(I,K)*AU(I,K-1))
1321 AU(I,K) = FK*CU(I,K)
1322 A1(I,K) = FK*(R1(I,K)-CL(I,K)*A1(I,K-1))
1323 A2(I,K) = FK*(R2(I,K)-CL(I,K)*A2(I,K-1))
1327 FK = 1./(CM(I,N)-CL(I,N)*AU(I,N-1))
1328 A1(I,N) = FK*(R1(I,N)-CL(I,N)*A1(I,N-1))
1329 A2(I,N) = FK*(R2(I,N)-CL(I,N)*A2(I,N-1))
1333 A1(I,K) = A1(I,K)-AU(I,K)*A1(I,K+1)
1334 A2(I,K) = A2(I,K)-AU(I,K)*A2(I,K+1)
1337 !-----------------------------------------------------------------------
1339 END SUBROUTINE TRIDI2
1341 !-----------------------------------------------------------------------
1342 SUBROUTINE TRIDIN(L,N,nt,CL,CM,CU,R1,R2,AU,A1,A2)
1343 !sela %INCLUDE DBTRIDI2;
1345 USE MODULE_GFS_MACHINE, ONLY : kind_phys
1347 integer is,k,kk,n,nt,l,i
1348 real(kind=kind_phys) fk(L)
1350 real(kind=kind_phys) CL(L,2:N), CM(L,N), CU(L,N-1), &
1351 & R1(L,N), R2(L,N*nt), &
1352 & AU(L,N-1), A1(L,N), A2(L,N*nt), &
1354 !-----------------------------------------------------------------------
1357 AU(I,1) = FK(I)*CU(I,1)
1358 A1(I,1) = FK(I)*R1(I,1)
1363 a2(i,1+is) = fk(I) * r2(i,1+is)
1368 FKK(I,K) = 1./(CM(I,K)-CL(I,K)*AU(I,K-1))
1369 AU(I,K) = FKK(I,K)*CU(I,K)
1370 A1(I,K) = FKK(I,K)*(R1(I,K)-CL(I,K)*A1(I,K-1))
1377 A2(I,K+is) = FKK(I,K)*(R2(I,K+is)-CL(I,K)*A2(I,K+is-1))
1382 FK(I) = 1./(CM(I,N)-CL(I,N)*AU(I,N-1))
1383 A1(I,N) = FK(I)*(R1(I,N)-CL(I,N)*A1(I,N-1))
1388 A2(I,N+is) = FK(I)*(R2(I,N+is)-CL(I,N)*A2(I,N+is-1))
1393 A1(I,K) = A1(I,K) - AU(I,K)*A1(I,K+1)
1400 A2(I,K+is) = A2(I,K+is) - AU(I,K)*A2(I,K+is+1)
1404 !-----------------------------------------------------------------------
1406 END SUBROUTINE TRIDIN
1407 SUBROUTINE TRIDIT(L,N,nt,CL,CM,CU,RT,AU,AT)
1408 !sela %INCLUDE DBTRIDI2;
1410 USE MODULE_GFS_MACHINE, ONLY : kind_phys
1412 integer is,k,kk,n,nt,l,i
1413 real(kind=kind_phys) fk(L)
1415 real(kind=kind_phys) CL(L,2:N), CM(L,N), CU(L,N-1), &
1417 & AU(L,N-1), AT(L,N*nt), &
1419 !-----------------------------------------------------------------------
1422 AU(I,1) = FK(I)*CU(I,1)
1427 at(i,1+is) = fk(I) * rt(i,1+is)
1432 FKK(I,K) = 1./(CM(I,K)-CL(I,K)*AU(I,K-1))
1433 AU(I,K) = FKK(I,K)*CU(I,K)
1440 AT(I,K+is) = FKK(I,K)*(RT(I,K+is)-CL(I,K)*AT(I,K+is-1))
1445 FK(I) = 1./(CM(I,N)-CL(I,N)*AU(I,N-1))
1450 AT(I,N+is) = FK(I)*(RT(I,N+is)-CL(I,N)*AT(I,N+is-1))
1457 AT(I,K+is) = AT(I,K+is) - AU(I,K)*AT(I,K+is+1)
1461 !-----------------------------------------------------------------------
1463 END SUBROUTINE TRIDIT
1465 !-----------------------------------------------------------------------
1467 END MODULE module_bl_gfs