MODULE MODULE_SF_MYJSFC USE MODULE_MODEL_CONSTANTS USE MODULE_DM, ONLY : WRF_DM_MAXVAL INTEGER :: ITRMX=5 REAL,PARAMETER :: VKARMAN=0.4 REAL,PARAMETER :: CAPA=R_D/CP,ELOCP=2.72E6/CP,RCAP=1./CAPA REAL,PARAMETER :: GOCP02=G/CP*2.,GOCP10=G/CP*10. REAL,PARAMETER :: EPSU2=1.E-6,EPSUST=1.e-9,EPSZT=1.E-28 REAL,PARAMETER :: A2S=17.2693882,A3S=273.16,A4S=35.86 REAL,PARAMETER :: SEAFC=0.98,PQ0SEA=PQ0*SEAFC REAL,PARAMETER :: BETA=1./273.,EXCML=0.0001,EXCMS=0.0001 & & ,GLKBR=10.,GLKBS=30.,PI=3.1415926 & & ,QVISC=2.1E-5,RIC=0.505,SMALL=0.35 & & ,SQPR=0.84,SQSC=0.84,SQVISC=258.2,TVISC=2.1E-5 & & ,USTC=0.7,USTR=0.225,VISC=1.5E-5,FH=1.01 & & ,WWST=1.2,ZTFC=1.,TOPOFAC=9.0e-6 REAL,PARAMETER :: BTG=BETA*G,CZIV=SMALL*GLKBS & & ,GRRS=GLKBR/GLKBS & & ,RTVISC=1./TVISC,RVISC=1./VISC & & ,ZQRZT=SQSC/SQPR & & ,FZQ1=RTVISC*QVISC*ZQRZT & & ,FZQ2=RTVISC*QVISC*ZQRZT & & ,FZT1=RVISC *TVISC*SQPR & & ,FZT2=CZIV*GRRS*TVISC*SQPR & & ,FZU1=CZIV*VISC & & ,PIHF=0.5*PI & & ,RQVISC=1./QVISC & & ,USTFC=0.018/G & & ,WWST2=WWST*WWST INTEGER, PARAMETER :: KZTM=10001,KZTM2=KZTM-2 REAL :: DZETA1,DZETA2,FH01,FH02,ZTMAX1,ZTMAX2,ZTMIN1,ZTMIN2 REAL,DIMENSION(KZTM) :: PSIH1,PSIH2,PSIM1,PSIM2 CONTAINS SUBROUTINE MYJSFC(ITIMESTEP,HT,DZ & & ,PMID,PINT,TH,T,QV,QC,U,V,Q2 & & ,TSK,QSFC,THZ0,QZ0,UZ0,VZ0 & & ,LOWLYR,XLAND,IVGTYP,ISURBAN,IZ0TLND & & ,USTAR,ZNT,Z0BASE,PBLH,MAVAIL,RMOL & & ,AKHS,AKMS & & ,RIB & & ,CHS,CHS2,CQS2,HFX,QFX,FLX_LH,FLHC,FLQC & & ,QGH,CPM,CT & & ,U10,V10,T02,TH02,TSHLTR,TH10,Q02,QSHLTR,Q10,PSHLTR & & ,P1000mb,U10E,V10E & & ,IDS,IDE,JDS,JDE,KDS,KDE & & ,IMS,IME,JMS,JME,KMS,KME & & ,ITS,ITE,JTS,JTE,KTS,KTE) IMPLICIT NONE INTEGER,INTENT(IN) :: IDS,IDE,JDS,JDE,KDS,KDE & & ,IMS,IME,JMS,JME,KMS,KME & & ,ITS,ITE,JTS,JTE,KTS,KTE INTEGER,INTENT(IN) :: ITIMESTEP INTEGER,DIMENSION(IMS:IME,JMS:JME),INTENT(IN) :: LOWLYR REAL,DIMENSION(IMS:IME,JMS:JME),INTENT(IN) :: HT,MAVAIL,TSK & & ,XLAND,Z0BASE REAL,DIMENSION(IMS:IME,KMS:KME,JMS:JME),INTENT(IN) :: DZ & & ,PMID,PINT & & ,Q2,QC,QV & & ,T,TH & & ,U,V INTEGER,DIMENSION(IMS:IME,JMS:JME),INTENT(IN) :: IVGTYP INTEGER, INTENT(IN) :: ISURBAN INTEGER, INTENT(IN) :: IZ0TLND REAL,DIMENSION(IMS:IME,JMS:JME),INTENT(OUT) :: FLX_LH,HFX,PSHLTR & & ,QFX,Q10,QSHLTR & & ,TH10,TSHLTR,T02 & & ,U10,V10,TH02,Q02 & & ,U10E,V10E REAL,DIMENSION(IMS:IME,JMS:JME),INTENT(INOUT) :: AKHS,AKMS & & ,PBLH,QSFC REAL,DIMENSION(IMS:IME,JMS:JME),INTENT(OUT) :: RIB REAL,DIMENSION(IMS:IME,JMS:JME),INTENT(INOUT) :: QZ0,RMOL,THZ0 & & ,USTAR,UZ0,VZ0 & & ,ZNT REAL,DIMENSION(IMS:IME,JMS:JME),INTENT(OUT) :: CHS,CHS2,CQS2 & & ,CPM,CT,FLHC,FLQC & & ,QGH REAL,INTENT(IN) :: P1000mb INTEGER :: I,J,K,KFLIP,LMH,LPBL,NTSD REAL :: A,APESFC,B,BTGX,CWMLOW & & ,DQDT,DTDIF,DTDT,DUDT,DVDT & & ,FIS & & ,P02P,P10P,PLOW,PSFC,PTOP,QLOW,QS02,QS10 & & ,RAPA,RAPA02,RAPA10,RATIOMX,RDZ,SEAMASK,SM & & ,T02P,T10P,TEM,TH02P,TH10P,THLOW,THELOW,THM & & ,TLOW,TZ0,ULOW,VLOW,ZSL REAL,DIMENSION(KTS:KTE) :: CWMK,PK,Q2K,QK,THEK,THK,TK,UK,VK REAL,DIMENSION(KTS:KTE-1) :: EL,ELM REAL,DIMENSION(KTS:KTE+1) :: ZHK REAL,DIMENSION(ITS:ITE,JTS:JTE) :: THSK REAL,DIMENSION(ITS:ITE,KTS:KTE+1,JTS:JTE) :: ZINT DO J=JTS,JTE DO K=KTS,KTE+1 DO I=ITS,ITE ZINT(I,K,J)=0. ENDDO ENDDO ENDDO DO J=JTS,JTE DO I=ITS,ITE ZINT(I,KTE+1,J)=HT(I,J) PBLH(I,J)=-1. ENDDO ENDDO DO J=JTS,JTE DO K=KTE,KTS,-1 KFLIP=KTE+1-K DO I=ITS,ITE ZINT(I,K,J)=ZINT(I,K+1,J)+DZ(I,KFLIP,J) ENDDO ENDDO ENDDO NTSD=ITIMESTEP IF(NTSD==1)THEN DO J=JTS,JTE DO I=ITS,ITE USTAR(I,J)=0.1 FIS=HT(I,J)*G SM=XLAND(I,J)-1. ENDDO ENDDO ENDIF DO J=JTS,JTE DO I=ITS,ITE CT(I,J)=0. ENDDO ENDDO setup_integration: DO J=JTS,JTE DO I=ITS,ITE LMH=KTE-LOWLYR(I,J)+1 PTOP=PINT(I,KTE+1,J) PSFC=PINT(I,LOWLYR(I,J),J) THSK(I,J)=TSK(I,J)/(PSFC/P1000mb)**CAPA SEAMASK=XLAND(I,J)-1. DO K=KTE,KTS,-1 KFLIP=KTE+1-K THK(K)=TH(I,KFLIP,J) TK(K)=T(I,KFLIP,J) RATIOMX=QV(I,KFLIP,J) QK(K)=RATIOMX/(1.+RATIOMX) PK(K)=PMID(I,KFLIP,J) CWMK(K)=QC(I,KFLIP,J) THEK(K)=(CWMK(K)*(-ELOCP/TK(K))+1.)*THK(K) Q2K(K)=2.*Q2(I,KFLIP,J) ZHK(K)=ZINT(I,K,J) ENDDO ZHK(KTE+1)=HT(I,J) DO K=KTE,KTS,-1 KFLIP=KTE+1-K UK(K)=U(I,KFLIP,J) VK(K)=V(I,KFLIP,J) ENDDO LPBL=LMH DO K=LMH-1,1,-1 IF(Q2K(K)<=EPSQ2*FH) THEN LPBL=K GO TO 110 ENDIF ENDDO LPBL=1 110 PBLH(I,J)=ZHK(LPBL)-ZHK(LMH+1) PLOW=PK(LMH) TLOW=TK(LMH) THLOW=THK(LMH) THELOW=THEK(LMH) QLOW=QK(LMH) CWMLOW=CWMK(LMH) ULOW=UK(LMH) VLOW=VK(LMH) ZSL=(ZHK(LMH)-ZHK(LMH+1))*0.5 APESFC=(PSFC/P1000mb)**CAPA IF(NTSD==1)THEN TZ0=TSK(I,J) else TZ0=THZ0(I,J)*APESFC endif CALL SFCDIF(NTSD,SEAMASK,THSK(I,J),QSFC(I,J),PSFC & & ,UZ0(I,J),VZ0(I,J),TZ0,TSK(I,J),THZ0(I,J),QZ0(I,J) & & ,USTAR(I,J),ZNT(I,J),Z0BASE(I,J),CT(I,J),RMOL(I,J) & & ,AKMS(I,J),AKHS(I,J),RIB(I,J),PBLH(I,J),MAVAIL(I,J) & & ,IVGTYP(I,J),ISURBAN,IZ0TLND & & ,CHS(I,J),CHS2(I,J),CQS2(I,J) & & ,HFX(I,J),QFX(I,J),FLX_LH(I,J) & & ,FLHC(I,J),FLQC(I,J),QGH(I,J),CPM(I,J) & & ,ULOW,VLOW,TLOW,THLOW,THELOW,QLOW,CWMLOW & & ,ZSL,PLOW & & ,U10(I,J),V10(I,J),TSHLTR(I,J),TH10(I,J) & & ,QSHLTR(I,J),Q10(I,J),PSHLTR(I,J) & & ,U10E(I,J),V10E(I,J) & & ,IDS,IDE,JDS,JDE,KDS,KDE & & ,IMS,IME,JMS,JME,KMS,KME & & ,ITS,ITE,JTS,JTE,KTS,KTE,i,j,ZHK(LMH+1)) RAPA=APESFC TH02P=TSHLTR(I,J) TH10P=TH10(I,J) TH02(I,J)=TSHLTR(I,J) RAPA02=RAPA-GOCP02/TH02P RAPA10=RAPA-GOCP10/TH10P T02P=TH02P*RAPA02 T10P=TH10P*RAPA10 T02(I,J) = TH02(I,J)*APESFC P02P=(RAPA02**RCAP)*P1000mb P10P=(RAPA10**RCAP)*P1000mb QS02=PQ0/P02P*EXP(A2*(T02P-A3)/(T02P-A4)) QS10=PQ0/P10P*EXP(A2*(T10P-A3)/(T10P-A4)) IF(QSHLTR(I,J)>QS02)QSHLTR(I,J)=QS02 IF(Q10 (I,J)>QS10)Q10 (I,J)=QS10 Q02(I,J)=QSHLTR(I,J)/(1.-QSHLTR(I,J)) ENDDO ENDDO setup_integration END SUBROUTINE MYJSFC SUBROUTINE SFCDIF(NTSD,SEAMASK,THS,QS,PSFC & & ,UZ0,VZ0,TZ0,TSK,THZ0,QZ0 & & ,USTAR,Z0,Z0BASE,CT,RLMO,AKMS,AKHS,RIB,PBLH,WETM & & ,VEGTYP,ISURBAN,IZ0TLND & & ,CHS,CHS2,CQS2,HFX,QFX,FLX_LH,FLHC,FLQC,QGH,CPM & & ,ULOW,VLOW,TLOW,THLOW,THELOW,QLOW,CWMLOW & & ,ZSL,PLOW & & ,U10,V10,TH02,TH10,Q02,Q10,PSHLTR & & ,U10E,V10E & & ,IDS,IDE,JDS,JDE,KDS,KDE & & ,IMS,IME,JMS,JME,KMS,KME & & ,ITS,ITE,JTS,JTE,KTS,KTE,i,j,ZSFC) IMPLICIT NONE INTEGER,INTENT(IN) :: IDS,IDE,JDS,JDE,KDS,KDE & & ,IMS,IME,JMS,JME,KMS,KME & & ,ITS,ITE,JTS,JTE,KTS,KTE,i,j INTEGER,INTENT(IN) :: NTSD REAL,INTENT(IN) :: CWMLOW,PBLH,PLOW,QLOW,PSFC,SEAMASK,ZSFC & & ,THELOW,THLOW,THS,TSK,TLOW,TZ0,ULOW,VLOW,WETM,ZSL & & ,Z0BASE INTEGER, INTENT(IN) :: VEGTYP, ISURBAN, IZ0TLND REAL,INTENT(OUT) :: CHS,CHS2,CPM,CQS2,CT,FLHC,FLQC,FLX_LH,HFX & & ,PSHLTR,Q02,Q10,QFX,QGH,RIB,RLMO & & ,TH02,TH10,U10,V10,U10E,V10E REAL,INTENT(INOUT) :: AKHS,AKMS,QZ0,THZ0,USTAR,UZ0,VZ0,Z0,QS INTEGER :: ITR,K REAL :: A,B,BTGH,BTGX,CXCHL,CXCHS,CZETMAX,DTHV,DU2,ELFC,FCT & & ,HLFLX,HSFLX,HV,PSH02,PSH10,PSHZ,PSHZL,PSM10,PSMZ,PSMZL & & ,RDZ,RDZT,RLMA,RLMN,RLMP & & ,RLOGT,RLOGU,RWGH,RZ,RZST,RZSU,SIMH,SIMM,TEM,THM & & ,UMFLX,USTARK,VMFLX,WGHT,WGHTT,WGHTQ,WSTAR2 & & ,X,XLT,XLT4,XLU,XLU4,XT,XT4,XU,XU4,ZETALT,ZETALU & & ,ZETAT,ZETAU,ZQ,ZSLT,ZSLU,ZT,ZU,TOPOTERM,ZZIL REAL :: CZIL,ZILFC REAL :: AKHS02,AKHS10,AKMS02,AKMS10,EKMS10,QSAT10,QSAT2 & & ,RLNT02,RLNT10,RLNU10,SIMH02,SIMH10,SIMM10,T02,T10 & & ,TERM1,RLOW,WSTAR,XLT02,XLT024,XLT10 & & ,XLT104,XLU10,XLU104,XU10,XU104,ZT02,ZT10,ZTAT02,ZTAT10 & & ,ZTAU,ZTAU10,ZU10,ZUUZ RDZ=1./ZSL CXCHL=EXCML*RDZ CXCHS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MAX(K,0) PSM10=(PSIM2(K+2)-PSIM2(K+1))*RDZT+PSIM2(K+1) SIMM10=PSM10-PSMZ+RLNU10 RZ=(ZTAT02-ZTMIN2)/DZETA2 K=INT(RZ) RDZT=RZ-REAL(K) K=MIN(K,KZTM2) K=MAX(K,0) PSH02=(PSIH2(K+2)-PSIH2(K+1))*RDZT+PSIH2(K+1) SIMH02=(PSH02-PSHZ+RLNT02)*FH02 RZ=(ZTAT10-ZTMIN2)/DZETA2 K=INT(RZ) RDZT=RZ-REAL(K) K=MIN(K,KZTM2) K=MAX(K,0) PSH10=(PSIH2(K+2)-PSIH2(K+1))*RDZT+PSIH2(K+1) SIMH10=(PSH10-PSHZ+RLNT10)*FH02 AKMS10=MAX(USTARK/SIMM10,CXCHL) AKHS02=MAX(USTARK/SIMH02,CXCHL) AKHS10=MAX(USTARK/SIMH10,CXCHL) ENDIF U10 =UMFLX/AKMS10+UZ0 V10 =VMFLX/AKMS10+VZ0 TH02=HSFLX/AKHS02+THZ0 IF(THLOW>THZ0.AND.(TH02THLOW).OR. & THLOWTHZ0.OR.TH02THZ0.AND.(TH10THLOW).OR. & THLOWTHZ0.OR.TH100.5)THEN QS=PQ0SEA/PSFC & & *EXP(A2S*(TSK-A3S)/(TSK-A4S)) QS=QS/(1.-QS) ENDIF END SUBROUTINE SFCDIF SUBROUTINE MYJSFCINIT(LOWLYR,USTAR,Z0 & & ,SEAMASK,XICE,IVGTYP,RESTART & & ,ALLOWED_TO_READ & & ,IDS,IDE,JDS,JDE,KDS,KDE & & ,IMS,IME,JMS,JME,KMS,KME & & ,ITS,ITE,JTS,JTE,KTS,KTE) IMPLICIT NONE LOGICAL,INTENT(IN) :: RESTART,ALLOWED_TO_READ INTEGER,INTENT(IN) :: IDS,IDE,JDS,JDE,KDS,KDE & & ,IMS,IME,JMS,JME,KMS,KME & & ,ITS,ITE,JTS,JTE,KTS,KTE INTEGER,DIMENSION(IMS:IME,JMS:JME),INTENT(IN) :: IVGTYP INTEGER,DIMENSION(IMS:IME,JMS:JME),INTENT(INOUT) :: LOWLYR REAL,DIMENSION(IMS:IME,JMS:JME),INTENT(IN) :: SEAMASK,XICE REAL,DIMENSION(IMS:IME,JMS:JME),INTENT(INOUT) :: USTAR,Z0 REAL,DIMENSION(0:30) :: VZ0TBL REAL,DIMENSION(0:30) :: VZ0TBL_24 INTEGER :: I,IDUM,IRECV,J,JDUM,K,ITF,JTF,KTF,MAXGBL_IVGTYP & &, MAXLOC_IVGTYP,MPI_COMM_COMP REAL :: SM,X,ZETA1,ZETA2,ZRNG1,ZRNG2 REAL :: PIHF=3.1415926/2.,EPS=1.E-6 VZ0TBL= & & (/0., & & 2.653,0.826,0.563,1.089,0.854,0.856,0.035,0.238,0.065,0.076 & & ,0.011,0.035,0.011,0.000,0.000,0.000,0.000,0.000,0.000,0.000 & & ,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000/) VZ0TBL_24= (/0., & & 1.00, 0.07, 0.07, 0.07, 0.07, 0.15, & & 0.08, 0.03, 0.05, 0.86, 0.80, 0.85, & & 2.65, 1.09, 0.80, 0.001, 0.04, 0.05, & & 0.01, 0.04, 0.06, 0.05, 0.03, 0.001, & & 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 /) JTF=MIN0(JTE,JDE-1) KTF=MIN0(KTE,KDE-1) ITF=MIN0(ITE,IDE-1) DO J=JTS,JTF DO I=ITS,ITF LOWLYR(I,J)=1 ENDDO ENDDO IF(.NOT.RESTART)THEN DO J=JTS,JTE DO I=ITS,ITF USTAR(I,J)=0.1 ENDDO ENDDO ENDIF FH01=1. FH02=1. ZTMIN1=-5.0 ZTMAX1=1.0 ZTMIN2=-5.0 ZTMAX2=1.0 ZRNG1=ZTMAX1-ZTMIN1 ZRNG2=ZTMAX2-ZTMIN2 DZETA1=ZRNG1/(KZTM-1) DZETA2=ZRNG2/(KZTM-1) ZETA1=ZTMIN1 ZETA2=ZTMIN2 DO K=1,KZTM IF(ZETA1<0.)THEN X=SQ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