1 !WRF:MODEL_LAYER:PHYSICS
3 MODULE module_sf_sfcdiags
7 SUBROUTINE SFCDIAGS(HFX,QFX,TSK,QSFC,CHS2,CQS2,T2,TH2,Q2, &
8 PSFC,CP,R_d,ROVCP,CHS,T3D,QV3D,UA_PHYS, &
9 ids,ide, jds,jde, kds,kde, &
10 ims,ime, jms,jme, kms,kme, &
11 its,ite, jts,jte, kts,kte )
12 !-------------------------------------------------------------------
14 !-------------------------------------------------------------------
15 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, &
16 ims,ime, jms,jme, kms,kme, &
17 its,ite, jts,jte, kts,kte
18 REAL, DIMENSION( ims:ime, jms:jme ) , &
23 REAL, DIMENSION( ims:ime, jms:jme ) , &
24 INTENT(INOUT) :: Q2, &
27 REAL, DIMENSION( ims:ime, jms:jme ) , &
31 REAL, INTENT(IN ) :: CP,R_d,ROVCP
34 LOGICAL, INTENT(IN) :: UA_PHYS ! UA: flag for UA option
35 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) , &
36 INTENT(IN ) :: QV3D,T3D
37 REAL, DIMENSION( ims:ime, jms:jme ) , &
46 RHO = PSFC(I,J)/(R_d * TSK(I,J))
47 if(CQS2(I,J).lt.1.E-5) then
51 Q2(I,J) = QSFC(I,J) - CHS(I,J)/CQS2(I,J)*(QSFC(I,J) - QV3D(i,1,j))
54 Q2(I,J) = QSFC(I,J) - amax1(amin1(CHS(I,J)/CQS2(I,J),0.0),2.0)*(QSFC(I,J) - QV3D(i,1,j))
56 Q2(I,J) = QSFC(I,J) - QFX(I,J)/(RHO*CQS2(I,J))
60 if(CHS2(I,J).lt.1.E-5) then
64 T2(I,J) = TSK(I,J) - CHS(I,J)/CHS2(I,J)*(TSK(I,J) - T3D(i,1,j))
67 T2(I,J) = TSK(I,J) - amax1(amin1(CHS(I,J)/CHS2(I,J),0.0),2.0)*(TSK(I,J) - T3D(i,1,j))
69 T2(I,J) = TSK(I,J) - HFX(I,J)/(RHO*CP*CHS2(I,J))
73 TH2(I,J) = T2(I,J)*(1.E5/PSFC(I,J))**ROVCP
77 END SUBROUTINE SFCDIAGS
79 END MODULE module_sf_sfcdiags