1 !WRF:MODEL_LAYER:PHYSICS
3 MODULE module_sf_sfclay
5 REAL , PARAMETER :: VCONVC=1.
6 REAL , PARAMETER :: CZO=0.0185
7 REAL , PARAMETER :: OZO=1.59E-5
9 REAL, DIMENSION(0:1000 ),SAVE :: PSIMTB,PSIHTB
13 !-------------------------------------------------------------------
14 SUBROUTINE SFCLAY(U3D,V3D,T3D,QV3D,P3D,dz8w, &
15 CP,G,ROVCP,R,XLV,PSFC,CHS,CHS2,CQS2,CPM, &
16 ZNT,UST,PBLH,MAVAIL,ZOL,MOL,REGIME,PSIM,PSIH, &
18 XLAND,HFX,QFX,LH,TSK,FLHC,FLQC,QGH,QSFC,RMOL, &
20 GZ1OZ0,WSPD,BR,ISFFLX,DX, &
21 SVP1,SVP2,SVP3,SVPT0,EP1,EP2, &
22 KARMAN,EOMEG,STBOLT, &
24 ids,ide, jds,jde, kds,kde, &
25 ims,ime, jms,jme, kms,kme, &
26 its,ite, jts,jte, kts,kte, &
28 isftcflx,iz0tlnd,scm_force_flux)
29 !-------------------------------------------------------------------
31 !-------------------------------------------------------------------
32 ! Changes in V3.7 over water surfaces:
33 ! 1. for ZNT/Cd, replacing constant OZO with 0.11*1.5E-5/UST(I)
34 ! the COARE 3.5 (Edson et al. 2013) formulation is also available
35 ! 2. for VCONV, reducing magnitude by half
36 ! 3. for Ck, replacing Carlson-Boland with COARE 3
37 !-------------------------------------------------------------------
38 !-- U3D 3D u-velocity interpolated to theta points (m/s)
39 !-- V3D 3D v-velocity interpolated to theta points (m/s)
40 !-- T3D temperature (K)
41 !-- QV3D 3D water vapor mixing ratio (Kg/Kg)
42 !-- P3D 3D pressure (Pa)
43 !-- dz8w dz between full levels (m)
44 !-- CP heat capacity at constant pressure for dry air (J/kg/K)
45 !-- G acceleration due to gravity (m/s^2)
47 !-- R gas constant for dry air (J/kg/K)
48 !-- XLV latent heat of vaporization for water (J/kg)
49 !-- PSFC surface pressure (Pa)
50 !-- ZNT roughness length (m)
51 !-- UST u* in similarity theory (m/s)
52 !-- USTM u* in similarity theory (m/s) without vconv correction
53 ! used to couple with TKE scheme
54 !-- PBLH PBL height from previous time (m)
55 !-- MAVAIL surface moisture availability (between 0 and 1)
56 !-- ZOL z/L height over Monin-Obukhov length
57 !-- MOL T* (similarity theory) (K)
58 !-- REGIME flag indicating PBL regime (stable, unstable, etc.)
59 !-- PSIM similarity stability function for momentum
60 !-- PSIH similarity stability function for heat
61 !-- FM integrated stability function for momentum
62 !-- FH integrated stability function for heat
63 !-- XLAND land mask (1 for land, 2 for water)
64 !-- HFX upward heat flux at the surface (W/m^2)
65 !-- QFX upward moisture flux at the surface (kg/m^2/s)
66 !-- LH net upward latent heat flux at surface (W/m^2)
67 !-- TSK surface temperature (K)
68 !-- FLHC exchange coefficient for heat (W/m^2/K)
69 !-- FLQC exchange coefficient for moisture (kg/m^2/s)
70 !-- CHS heat/moisture exchange coefficient for LSM (m/s)
71 !-- QGH lowest-level saturated mixing ratio
72 !-- QSFC ground saturated mixing ratio
73 !-- U10 diagnostic 10m u wind
74 !-- V10 diagnostic 10m v wind
75 !-- TH2 diagnostic 2m theta (K)
76 !-- T2 diagnostic 2m temperature (K)
77 !-- Q2 diagnostic 2m mixing ratio (kg/kg)
78 !-- GZ1OZ0 log(z/z0) where z0 is roughness length
79 !-- WSPD wind speed at lowest model level (m/s)
80 !-- BR bulk Richardson number in surface layer
81 !-- ISFFLX isfflx=1 for surface heat and moisture fluxes
82 !-- DX horizontal grid size (m)
83 !-- SVP1 constant for saturation vapor pressure (kPa)
84 !-- SVP2 constant for saturation vapor pressure (dimensionless)
85 !-- SVP3 constant for saturation vapor pressure (K)
86 !-- SVPT0 constant for saturation vapor pressure (K)
87 !-- EP1 constant for virtual temperature (R_v/R_d - 1) (dimensionless)
88 !-- EP2 constant for specific humidity calculation
89 ! (R_d/R_v) (dimensionless)
90 !-- KARMAN Von Karman constant
91 !-- EOMEG angular velocity of earth's rotation (rad/s)
92 !-- STBOLT Stefan-Boltzmann constant (W/m^2/K^4)
93 !-- ck enthalpy exchange coeff at 10 meters
94 !-- cd momentum exchange coeff at 10 meters
95 !-- cka enthalpy exchange coeff at the lowest model level
96 !-- cda momentum exchange coeff at the lowest model level
97 !-- isftcflx =0, (Charnock and Carlson-Boland); =1, AHW Ck, Cd, =2 Garratt
98 !-- iz0tlnd =0 Carlson-Boland, =1 Czil_new
99 !-- ids start index for i in domain
100 !-- ide end index for i in domain
101 !-- jds start index for j in domain
102 !-- jde end index for j in domain
103 !-- kds start index for k in domain
104 !-- kde end index for k in domain
105 !-- ims start index for i in memory
106 !-- ime end index for i in memory
107 !-- jms start index for j in memory
108 !-- jme end index for j in memory
109 !-- kms start index for k in memory
110 !-- kme end index for k in memory
111 !-- its start index for i in tile
112 !-- ite end index for i in tile
113 !-- jts start index for j in tile
114 !-- jte end index for j in tile
115 !-- kts start index for k in tile
116 !-- kte end index for k in tile
117 !-------------------------------------------------------------------
118 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, &
119 ims,ime, jms,jme, kms,kme, &
120 its,ite, jts,jte, kts,kte
122 INTEGER, INTENT(IN ) :: ISFFLX
123 REAL, INTENT(IN ) :: SVP1,SVP2,SVP3,SVPT0
124 REAL, INTENT(IN ) :: EP1,EP2,KARMAN,EOMEG,STBOLT
125 REAL, INTENT(IN ) :: P1000mb
127 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) , &
130 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) , &
131 INTENT(IN ) :: QV3D, &
135 REAL, DIMENSION( ims:ime, jms:jme ) , &
136 INTENT(IN ) :: MAVAIL, &
141 REAL, DIMENSION( ims:ime, jms:jme ) , &
142 INTENT(INOUT) :: REGIME, &
148 REAL, DIMENSION( ims:ime, jms:jme ) , &
149 INTENT(INOUT) :: GZ1OZ0,WSPD,BR, &
152 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) , &
153 INTENT(IN ) :: U3D, &
156 REAL, DIMENSION( ims:ime, jms:jme ) , &
159 REAL, DIMENSION( ims:ime, jms:jme ) , &
160 INTENT(INOUT) :: ZNT, &
168 REAL, DIMENSION( ims:ime, jms:jme ) , &
169 INTENT(INOUT) :: FLHC,FLQC
171 REAL, DIMENSION( ims:ime, jms:jme ) , &
174 REAL, INTENT(IN ) :: CP,G,ROVCP,R,XLV
176 REAL, DIMENSION( ims:ime, jms:jme ) , &
179 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ) , &
180 INTENT(OUT) :: ck,cka,cd,cda
182 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ) , &
183 INTENT(INOUT) :: USTM
185 INTEGER, OPTIONAL, INTENT(IN ) :: ISFTCFLX, IZ0TLND
186 INTEGER, OPTIONAL, INTENT(IN ) :: SCM_FORCE_FLUX
188 REAL, DIMENSION( ims:ime, jms:jme ) , &
189 INTENT(INOUT ) :: QSFC
191 REAL, DIMENSION( ims:ime, jms:jme ) , &
192 INTENT(OUT ) :: U10, &
200 REAL, DIMENSION( its:ite ) :: U1D, &
206 REAL, DIMENSION( its:ite ) :: dz8w1d
208 REAL, DIMENSION( its:ite ) :: DX2D
219 dz8w1d(I) = dz8w(i,1,j)
230 ! Sending array starting locations of optional variables may cause
231 ! troubles, so we explicitly change the call.
233 CALL SFCLAY1D(J,U1D,V1D,T1D,QV1D,P1D,dz8w1d, &
234 CP,G,ROVCP,R,XLV,PSFC(ims,j),CHS(ims,j),CHS2(ims,j),&
235 CQS2(ims,j),CPM(ims,j),PBLH(ims,j), RMOL(ims,j), &
236 ZNT(ims,j),UST(ims,j),MAVAIL(ims,j),ZOL(ims,j), &
237 MOL(ims,j),REGIME(ims,j),PSIM(ims,j),PSIH(ims,j), &
238 FM(ims,j),FH(ims,j), &
239 XLAND(ims,j),HFX(ims,j),QFX(ims,j),TSK(ims,j), &
240 U10(ims,j),V10(ims,j),TH2(ims,j),T2(ims,j), &
241 Q2(ims,j),FLHC(ims,j),FLQC(ims,j),QGH(ims,j), &
242 QSFC(ims,j),LH(ims,j), &
243 GZ1OZ0(ims,j),WSPD(ims,j),BR(ims,j),ISFFLX,DX2D, &
244 SVP1,SVP2,SVP3,SVPT0,EP1,EP2,KARMAN,EOMEG,STBOLT, &
246 ids,ide, jds,jde, kds,kde, &
247 ims,ime, jms,jme, kms,kme, &
248 its,ite, jts,jte, kts,kte &
249 #if ( ( EM_CORE == 1 ) || ( defined(mpas) ) )
250 ,isftcflx,iz0tlnd,scm_force_flux, &
251 USTM(ims,j),CK(ims,j),CKA(ims,j), &
252 CD(ims,j),CDA(ims,j) &
258 END SUBROUTINE SFCLAY
261 !-------------------------------------------------------------------
262 SUBROUTINE SFCLAY1D(J,UX,VX,T1D,QV1D,P1D,dz8w1d, &
263 CP,G,ROVCP,R,XLV,PSFCPA,CHS,CHS2,CQS2,CPM,PBLH,RMOL, &
264 ZNT,UST,MAVAIL,ZOL,MOL,REGIME,PSIM,PSIH,FM,FH,&
266 U10,V10,TH2,T2,Q2,FLHC,FLQC,QGH, &
267 QSFC,LH,GZ1OZ0,WSPD,BR,ISFFLX,DX, &
268 SVP1,SVP2,SVP3,SVPT0,EP1,EP2, &
269 KARMAN,EOMEG,STBOLT, &
271 ids,ide, jds,jde, kds,kde, &
272 ims,ime, jms,jme, kms,kme, &
273 its,ite, jts,jte, kts,kte, &
274 isftcflx, iz0tlnd, scm_force_flux, &
276 !-------------------------------------------------------------------
278 !-------------------------------------------------------------------
279 REAL, PARAMETER :: XKA=2.4E-5
280 REAL, PARAMETER :: PRT=1.
282 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, &
283 ims,ime, jms,jme, kms,kme, &
284 its,ite, jts,jte, kts,kte, &
287 INTEGER, INTENT(IN ) :: ISFFLX
288 REAL, INTENT(IN ) :: SVP1,SVP2,SVP3,SVPT0
289 REAL, INTENT(IN ) :: EP1,EP2,KARMAN,EOMEG,STBOLT
290 REAL, INTENT(IN ) :: P1000mb
293 REAL, DIMENSION( ims:ime ) , &
294 INTENT(IN ) :: MAVAIL, &
299 REAL, DIMENSION( ims:ime ) , &
300 INTENT(IN ) :: PSFCPA
302 REAL, DIMENSION( ims:ime ) , &
303 INTENT(INOUT) :: REGIME, &
307 !m the following 5 are changed to memory size---
309 REAL, DIMENSION( ims:ime ) , &
310 INTENT(INOUT) :: GZ1OZ0,WSPD,BR, &
313 REAL, DIMENSION( ims:ime ) , &
314 INTENT(INOUT) :: ZNT, &
322 REAL, DIMENSION( ims:ime ) , &
323 INTENT(INOUT) :: FLHC,FLQC
325 REAL, DIMENSION( ims:ime ) , &
329 REAL, DIMENSION( ims:ime ) , &
330 INTENT(OUT) :: U10,V10, &
333 REAL, INTENT(IN ) :: CP,G,ROVCP,R,XLV
335 REAL, DIMENSION( its:ite ), INTENT(IN ) :: DX
337 ! MODULE-LOCAL VARIABLES, DEFINED IN SUBROUTINE SFCLAY
338 REAL, DIMENSION( its:ite ), INTENT(IN ) :: dz8w1d
340 REAL, DIMENSION( its:ite ), INTENT(IN ) :: UX, &
346 REAL, OPTIONAL, DIMENSION( ims:ime ) , &
347 INTENT(OUT) :: ck,cka,cd,cda
348 REAL, OPTIONAL, DIMENSION( ims:ime ) , &
349 INTENT(INOUT) :: USTM
351 INTEGER, OPTIONAL, INTENT(IN ) :: ISFTCFLX, IZ0TLND
352 INTEGER, OPTIONAL, INTENT(IN ) :: SCM_FORCE_FLUX
356 REAL, DIMENSION( its:ite ) :: ZA, &
371 REAL, DIMENSION( its:ite ) :: &
375 REAL, DIMENSION( its:ite) :: SCR3,SCR4
376 REAL, DIMENSION( its:ite ) :: THGB, PSFC
380 INTEGER :: N,I,K,KK,L,NZOL,NK,NZOL2,NZOL10
382 REAL :: PL,THCON,TVCON,E1
383 REAL :: ZL,TSKV,DTHVDZ,DTHVM,VCONV,RZOL,RZOL2,RZOL10,ZOL2,ZOL10
384 REAL :: DTG,PSIX,DTTHX,PSIX10,PSIT,PSIT2,PSIQ,PSIQ2,PSIQ10
385 REAL :: FLUXC,VSGD,Z0Q,VISC,RESTAR,CZIL,GZ0OZQ,GZ0OZT
388 !-------------------------------------------------------------------
393 PSFC(I)=PSFCPA(I)/1000.
396 !----CONVERT GROUND TEMPERATURE TO POTENTIAL TEMPERATURE:
401 ! THGB(I)=TSK(I)*(100./PSFC(I))**ROVCP
402 THGB(I)=TSK(I)*(P1000mb/PSFCPA(I))**ROVCP
405 !-----DECOUPLE FLUX-FORM VARIABLES TO GIVE U,V,T,THETA,THETA-VIR.,
406 ! T-VIR., QV, AND QC AT CROSS POINTS AND AT KTAU-1.
409 ! THE BOUNDARY WINDS MAY NOT BE ADEQUATELY AFFECTED BY FRICTION,
410 ! SO USE ONLY INTERIOR VALUES OF UX AND VX TO CALCULATE
422 !.....SCR3(I,K) STORE TEMPERATURE,
423 ! SCR4(I,K) STORE VIRTUAL TEMPERATURE.
429 ! THCON=(100./PL)**ROVCP
430 THCON=(P1000mb*0.001/PL)**ROVCP
444 ! IF(IDRY.EQ.1)GOTO 80
449 SCR4(I)=SCR3(I)*TVCON
453 E1=SVP1*EXP(SVP2*(TGDSA(I)-SVPT0)/(TGDSA(I)-SVP3))
454 ! for land points QSFC can come from previous time step
455 if(xland(i).gt.1.5.or.qsfc(i).le.0.0)QSFC(I)=EP2*E1/(PSFC(I)-E1)
456 ! QGH CHANGED TO USE LOWEST-LEVEL AIR TEMP CONSISTENT WITH MYJSFC CHANGE
458 E1=SVP1*EXP(SVP2*(T1D(I)-SVPT0)/(T1D(I)-SVP3))
460 QGH(I)=EP2*E1/(PL-E1)
461 CPM(I)=CP*(1.+0.8*QX(I))
465 !-----COMPUTE THE HEIGHT OF FULL- AND HALF-SIGMA LEVELS ABOVE GROUND
466 ! LEVEL, AND THE LAYER THICKNESSES.
470 RHOX(I)=PSFC(I)*1000./(R*SCR4(I))
474 ZQKL(I)=dz8w1d(I)+ZQKLP1(I)
478 ZA(I)=0.5*(ZQKL(I)+ZQKLP1(I))
485 !-----CALCULATE BULK RICHARDSON NO. OF SURFACE LAYER, ACCORDING TO
489 GZ1OZ0(I)=ALOG(ZA(I)/ZNT(I))
490 GZ2OZ0(I)=ALOG(2./ZNT(I))
491 GZ10OZ0(I)=ALOG(10./ZNT(I))
492 IF((XLAND(I)-1.5).GE.0)THEN
497 WSPD(I)=SQRT(UX(I)*UX(I)+VX(I)*VX(I))
499 TSKV=THGB(I)*(1.+EP1*QSFC(I))
500 DTHVDZ=(THVX(I)-TSKV)
501 ! Convective velocity scale Vc and subgrid-scale velocity Vsg
502 ! following Beljaars (1994, QJRMS) and Mahrt and Sun (1995, MWR)
505 ! VCONV = 0.25*sqrt(g/tskv*pblh(i)*dthvm)
506 ! Use Beljaars over land, old MM5 (Wyngaard) formula over water
507 if (xland(i).lt.1.5) then
508 fluxc = max(hfx(i)/rhox(i)/cp &
509 + ep1*tskv*qfx(i)/rhox(i),0.)
510 VCONV = vconvc*(g/tgdsa(i)*pblh(i)*fluxc)**.33
517 ! VCONV = 2.*SQRT(DTHVM)
518 ! V3.7: reducing contribution in calm conditions
521 ! Mahrt and Sun low-res correction
522 VSGD = 0.32 * (max(dx(i)/5000.-1.,0.))**.33
523 WSPD(I)=SQRT(WSPD(I)*WSPD(I)+VCONV*VCONV+vsgd*vsgd)
524 WSPD(I)=AMAX1(WSPD(I),0.1)
525 BR(I)=GOVRTH(I)*ZA(I)*DTHVDZ/(WSPD(I)*WSPD(I))
526 ! IF PREVIOUSLY UNSTABLE, DO NOT LET INTO REGIMES 1 AND 2
527 IF(MOL(I).LT.0.)BR(I)=AMIN1(BR(I),0.0)
529 RMOL(I)=-GOVRTH(I)*DTHVDZ*ZA(I)*KARMAN
535 !-----DIAGNOSE BASIC PARAMETERS FOR THE APPROPRIATED STABILITY CLASS:
538 ! THE STABILITY CLASSES ARE DETERMINED BY BR (BULK RICHARDSON NO.)
539 ! AND HOL (HEIGHT OF PBL/MONIN-OBUKHOV LENGTH).
541 ! CRITERIA FOR THE CLASSES ARE AS FOLLOWS:
544 ! REPRESENTS NIGHTTIME STABLE CONDITIONS (REGIME=1),
546 ! 2. BR .LT. 0.2 .AND. BR .GT. 0.0;
547 ! REPRESENTS DAMPED MECHANICAL TURBULENT CONDITIONS
551 ! REPRESENTS FORCED CONVECTION CONDITIONS (REGIME=3),
554 ! REPRESENTS FREE CONVECTION CONDITIONS (REGIME=4).
560 !CC REMOVE REGIME 3 DEPENDENCE ON PBL HEIGHT
561 !CC IF(BR(I).LT.0..AND.HOL(I,J).GT.1.5)GOTO 310
562 IF(BR(I).LT.0.)GOTO 310
564 !-----CLASS 1; STABLE (NIGHTTIME) CONDITIONS:
566 IF(BR(I).LT.0.2)GOTO 270
568 PSIM(I)=-10.*GZ1OZ0(I)
569 ! LOWER LIMIT ON PSI IN STABLE CONDITIONS
570 PSIM(I)=AMAX1(PSIM(I),-10.)
572 PSIM10(I)=10./ZA(I)*PSIM(I)
573 PSIM10(I)=AMAX1(PSIM10(I),-10.)
575 PSIM2(I)=2./ZA(I)*PSIM(I)
576 PSIM2(I)=AMAX1(PSIM2(I),-10.)
579 ! 1.0 over Monin-Obukhov length
580 IF(UST(I).LT.0.01)THEN
581 RMOL(I)=BR(I)*GZ1OZ0(I) !ZA/L
583 RMOL(I)=KARMAN*GOVRTH(I)*ZA(I)*MOL(I)/(UST(I)*UST(I)) !ZA/L
585 RMOL(I)=AMIN1(RMOL(I),9.999) ! ZA/L
586 RMOL(I) = RMOL(I)/ZA(I) !1.0/L
590 !-----CLASS 2; DAMPED MECHANICAL TURBULENCE:
592 270 IF(BR(I).EQ.0.0)GOTO 280
594 PSIM(I)=-5.0*BR(I)*GZ1OZ0(I)/(1.1-5.0*BR(I))
595 ! LOWER LIMIT ON PSI IN STABLE CONDITIONS
596 PSIM(I)=AMAX1(PSIM(I),-10.)
597 !.....AKB(1976), EQ(16).
599 PSIM10(I)=10./ZA(I)*PSIM(I)
600 PSIM10(I)=AMAX1(PSIM10(I),-10.)
602 PSIM2(I)=2./ZA(I)*PSIM(I)
603 PSIM2(I)=AMAX1(PSIM2(I),-10.)
606 ! Linear form: PSIM = -0.5*ZA/L; e.g, see eqn 16 of
607 ! Blackadar, Modeling the nocturnal boundary layer, Preprints,
608 ! Third Symposium on Atmospheric Turbulence Diffusion and Air Quality,
610 ZOL(I) = BR(I)*GZ1OZ0(I)/(1.00001-5.0*BR(I))
612 if ( ZOL(I) .GT. 0.5 ) then ! linear form ok
613 ! Holtslag and de Bruin, J. App. Meteor 27, 689-704, 1988;
614 ! see also, Launiainen, Boundary-Layer Meteor 76,165-179, 1995
615 ! Eqn (8) of Launiainen, 1995
616 ZOL(I) = ( 1.89*GZ1OZ0(I) + 44.2 ) * BR(I)*BR(I) &
617 + ( 1.18*GZ1OZ0(I) - 1.37 ) * BR(I)
618 ZOL(I)=AMIN1(ZOL(I),9.999)
621 ! 1.0 over Monin-Obukhov length
622 RMOL(I)= ZOL(I)/ZA(I)
626 !-----CLASS 3; FORCED CONVECTION:
637 IF(UST(I).LT.0.01)THEN
638 ZOL(I)=BR(I)*GZ1OZ0(I)
640 ZOL(I)=KARMAN*GOVRTH(I)*ZA(I)*MOL(I)/(UST(I)*UST(I))
643 RMOL(I) = ZOL(I)/ZA(I)
647 !-----CLASS 4; FREE CONVECTION:
651 IF(UST(I).LT.0.01)THEN
652 ZOL(I)=BR(I)*GZ1OZ0(I)
654 ZOL(I)=KARMAN*GOVRTH(I)*ZA(I)*MOL(I)/(UST(I)*UST(I))
656 ZOL10=10./ZA(I)*ZOL(I)
658 ZOL(I)=AMIN1(ZOL(I),0.)
659 ZOL(I)=AMAX1(ZOL(I),-9.9999)
660 ZOL10=AMIN1(ZOL10,0.)
661 ZOL10=AMAX1(ZOL10,-9.9999)
663 ZOL2=AMAX1(ZOL2,-9.9999)
664 NZOL=INT(-ZOL(I)*100.)
665 RZOL=-ZOL(I)*100.-NZOL
666 NZOL10=INT(-ZOL10*100.)
667 RZOL10=-ZOL10*100.-NZOL10
668 NZOL2=INT(-ZOL2*100.)
669 RZOL2=-ZOL2*100.-NZOL2
670 PSIM(I)=PSIMTB(NZOL)+RZOL*(PSIMTB(NZOL+1)-PSIMTB(NZOL))
671 PSIH(I)=PSIHTB(NZOL)+RZOL*(PSIHTB(NZOL+1)-PSIHTB(NZOL))
672 PSIM10(I)=PSIMTB(NZOL10)+RZOL10*(PSIMTB(NZOL10+1)-PSIMTB(NZOL10))
673 PSIH10(I)=PSIHTB(NZOL10)+RZOL10*(PSIHTB(NZOL10+1)-PSIHTB(NZOL10))
674 PSIM2(I)=PSIMTB(NZOL2)+RZOL2*(PSIMTB(NZOL2+1)-PSIMTB(NZOL2))
675 PSIH2(I)=PSIHTB(NZOL2)+RZOL2*(PSIHTB(NZOL2+1)-PSIHTB(NZOL2))
677 !---LIMIT PSIH AND PSIM IN THE CASE OF THIN LAYERS AND HIGH ROUGHNESS
678 !--- THIS PREVENTS DENOMINATOR IN FLUXES FROM GETTING TOO SMALL
679 ! PSIH(I)=AMIN1(PSIH(I),0.9*GZ1OZ0(I))
680 ! PSIM(I)=AMIN1(PSIM(I),0.9*GZ1OZ0(I))
681 PSIH(I)=AMIN1(PSIH(I),0.9*GZ1OZ0(I))
682 PSIM(I)=AMIN1(PSIM(I),0.9*GZ1OZ0(I))
683 PSIH2(I)=AMIN1(PSIH2(I),0.9*GZ2OZ0(I))
684 PSIM10(I)=AMIN1(PSIM10(I),0.9*GZ10OZ0(I))
685 ! AHW: mods to compute ck, cd
686 PSIH10(I)=AMIN1(PSIH10(I),0.9*GZ10OZ0(I))
688 RMOL(I) = ZOL(I)/ZA(I)
692 !-----COMPUTE THE FRICTIONAL VELOCITY:
693 ! ZA(1982) EQS(2.60),(2.61).
697 PSIX=GZ1OZ0(I)-PSIM(I)
698 PSIX10=GZ10OZ0(I)-PSIM10(I)
699 ! LOWER LIMIT ADDED TO PREVENT LARGE FLHC IN SOIL MODEL
700 ! ACTIVATES IN UNSTABLE CONDITIONS WITH THIN LAYERS OR HIGH Z0
701 PSIT=AMAX1(GZ1OZ0(I)-PSIH(I),2.)
703 IF((XLAND(I)-1.5).GE.0)THEN
708 PSIQ=ALOG(KARMAN*UST(I)*ZA(I)/XKA+ZA(I)/ZL)-PSIH(I)
709 PSIT2=GZ2OZ0(I)-PSIH2(I)
710 PSIQ2=ALOG(KARMAN*UST(I)*2./XKA+2./ZL)-PSIH2(I)
711 ! AHW: mods to compute ck, cd
712 PSIQ10=ALOG(KARMAN*UST(I)*10./XKA+10./ZL)-PSIH10(I)
714 ! V3.7: using Fairall 2003 to compute z0q and z0t over water:
715 ! adapted from module_sf_mynn.F
716 IF ( (XLAND(I)-1.5).GE.0. ) THEN
717 VISC=(1.32+0.009*(SCR3(I)-273.15))*1.E-5
718 ! VISC=1.326e-5*(1. + 6.542e-3*SCR3(I) + 8.301e-6*SCR3(I)*SCR3(I) &
719 ! - 4.84e-9*SCR3(I)*SCR3(I)*SCR3(I))
720 RESTAR=UST(I)*ZNT(I)/VISC
721 Z0T = (5.5e-5)*(RESTAR**(-0.60))
722 Z0T = MIN(Z0T,1.0e-4)
723 Z0T = MAX(Z0T,2.0e-9)
726 PSIQ=max(ALOG((ZA(I)+Z0Q)/Z0Q)-PSIH(I), 2.)
727 PSIT=max(ALOG((ZA(I)+Z0T)/Z0T)-PSIH(I), 2.)
728 PSIQ2=max(ALOG((2.+Z0Q)/Z0Q)-PSIH2(I), 2.)
729 PSIT2=max(ALOG((2.+Z0T)/Z0T)-PSIH2(I), 2.)
730 PSIQ10=max(ALOG((10.+Z0Q)/Z0Q)-PSIH10(I), 2.)
733 IF ( PRESENT(ISFTCFLX) ) THEN
734 IF ( ISFTCFLX.EQ.1 .AND. (XLAND(I)-1.5).GE.0. ) THEN
736 ! Z0Q = 1.e-4 + 1.e-3*(MAX(0.,UST(I)-1.))**2
738 ! Z0Q = 0.62*2.0E-5/UST(I) + 1.E-3*(MAX(0.,UST(I)-1.5))**2
741 PSIQ=ALOG(ZA(I)/Z0Q)-PSIH(I)
743 PSIQ2=ALOG(2./Z0Q)-PSIH2(I)
744 PSIQ10=ALOG(10./Z0Q)-PSIH10(I)
747 IF ( ISFTCFLX.EQ.2 .AND. (XLAND(I)-1.5).GE.0. ) THEN
748 ! AHW: Garratt formula: Calculate roughness Reynolds number
749 ! Kinematic viscosity of air (linear approc to
750 ! temp dependence at sea level)
751 ! GZ0OZT and GZ0OZQ are based off formulas from Brutsaert (1975), which
752 ! Garratt (1992) used with values of k = 0.40, Pr = 0.71, and Sc = 0.60
753 VISC=(1.32+0.009*(SCR3(I)-273.15))*1.E-5
755 RESTAR=UST(I)*ZNT(I)/VISC
756 GZ0OZT=0.40*(7.3*SQRT(SQRT(RESTAR))*SQRT(0.71)-5.)
757 GZ0OZQ=0.40*(7.3*SQRT(SQRT(RESTAR))*SQRT(0.60)-5.)
758 PSIT=GZ1OZ0(I)-PSIH(I)+GZ0OZT
759 PSIQ=GZ1OZ0(I)-PSIH(I)+GZ0OZQ
760 PSIT2=GZ2OZ0(I)-PSIH2(I)+GZ0OZT
761 PSIQ2=GZ2OZ0(I)-PSIH2(I)+GZ0OZQ
762 PSIQ10=GZ10OZ0(I)-PSIH(I)+GZ0OZQ
765 IF(PRESENT(ck) .and. PRESENT(cd) .and. PRESENT(cka) .and. PRESENT(cda)) THEN
766 Ck(I)=(karman/psix10)*(karman/psiq10)
767 Cd(I)=(karman/psix10)*(karman/psix10)
768 Cka(I)=(karman/psix)*(karman/psiq)
769 Cda(I)=(karman/psix)*(karman/psix)
771 IF ( PRESENT(IZ0TLND) ) THEN
772 IF ( IZ0TLND.GE.1 .AND. (XLAND(I)-1.5).LE.0. ) THEN
774 ! CZIL RELATED CHANGES FOR LAND
775 VISC=(1.32+0.009*(SCR3(I)-273.15))*1.E-5
776 RESTAR=UST(I)*ZL/VISC
777 ! Modify CZIL according to Chen & Zhang, 2009 if iz0tlnd = 1
778 ! If iz0tlnd = 2, use traditional value
780 IF ( IZ0TLND.EQ.1 ) THEN
781 CZIL = 10.0 ** ( -0.40 * ( ZL / 0.07 ) )
782 ELSE IF ( IZ0TLND.EQ.2 ) THEN
786 PSIT=GZ1OZ0(I)-PSIH(I)+CZIL*KARMAN*SQRT(RESTAR)
787 PSIQ=GZ1OZ0(I)-PSIH(I)+CZIL*KARMAN*SQRT(RESTAR)
788 PSIT2=GZ2OZ0(I)-PSIH2(I)+CZIL*KARMAN*SQRT(RESTAR)
789 PSIQ2=GZ2OZ0(I)-PSIH2(I)+CZIL*KARMAN*SQRT(RESTAR)
793 ! TO PREVENT OSCILLATIONS AVERAGE WITH OLD VALUE
794 UST(I)=0.5*UST(I)+0.5*KARMAN*WSPD(I)/PSIX
795 ! TKE coupling: compute ust without vconv for use in tke scheme
796 WSPDI(I)=SQRT(UX(I)*UX(I)+VX(I)*VX(I))
797 IF ( PRESENT(USTM) ) THEN
798 USTM(I)=0.5*USTM(I)+0.5*KARMAN*WSPDI(I)/PSIX
800 U10(I)=UX(I)*PSIX10/PSIX
801 V10(I)=VX(I)*PSIX10/PSIX
802 TH2(I)=THGB(I)+DTG*PSIT2/PSIT
803 Q2(I)=QSFC(I)+(QX(I)-QSFC(I))*PSIQ2/PSIQ
804 ! T2(I) = TH2(I)*(PSFC(I)/100.)**ROVCP
805 T2(I) = TH2(I)*(PSFCPA(I)/P1000mb)**ROVCP
806 ! LATER Q2 WILL BE OVERWRITTEN FOR LAND POINTS IN SURFCE
810 ! write(*,1002)UST(I),KARMAN*WSPD(I),PSIX,KARMAN*WSPD(I)/PSIX
812 IF((XLAND(I)-1.5).LT.0.)THEN
813 UST(I)=AMAX1(UST(I),0.1)
815 MOL(I)=KARMAN*DTG/PSIT/PRT
825 !-----COMPUTE THE SURFACE SENSIBLE AND LATENT HEAT FLUXES:
826 IF ( PRESENT(SCM_FORCE_FLUX) ) THEN
827 IF (SCM_FORCE_FLUX.EQ.1) GOTO 350
835 IF (ISFFLX.EQ.0) GOTO 410
837 !-----OVER WATER, ALTER ROUGHNESS LENGTH (ZNT) ACCORDING TO WIND (UST).
840 IF((XLAND(I)-1.5).GE.0)THEN
841 ! ZNT(I)=CZO*UST(I)*UST(I)/G+OZO
842 ! Since V3.7 (ref: EC Physics document for Cy36r1)
843 ZNT(I)=CZO*UST(I)*UST(I)/G+0.11*1.5E-5/UST(I)
844 ! V3.9: Add limit as in isftcflx = 1,2
845 ZNT(I)=MIN(ZNT(I),2.85e-3)
846 ! COARE 3.5 (Edson et al. 2013)
847 ! CZC = 0.0017*WSPD(I)-0.005
848 ! CZC = min(CZC,0.028)
849 ! ZNT(I)=CZC*UST(I)*UST(I)/G+0.11*1.5E-5/UST(I)
850 ! AHW: change roughness length, and hence the drag coefficients Ck and Cd
851 IF ( PRESENT(ISFTCFLX) ) THEN
852 IF ( ISFTCFLX.NE.0 ) THEN
853 ! ZNT(I)=10.*exp(-9.*UST(I)**(-.3333))
854 ! ZNT(I)=10.*exp(-9.5*UST(I)**(-.3333))
855 ! ZNT(I)=ZNT(I) + 0.11*1.5E-5/AMAX1(UST(I),0.01)
856 ! ZNT(I)=0.011*UST(I)*UST(I)/G+OZO
857 ! ZNT(I)=MAX(ZNT(I),3.50e-5)
859 ZW = MIN((UST(I)/1.06)**(0.3),1.0)
860 ZN1 = 0.011*UST(I)*UST(I)/G + OZO
861 ZN2 = 10.*exp(-9.5*UST(I)**(-.3333)) + &
862 0.11*1.5E-5/AMAX1(UST(I),0.01)
863 ZNT(I)=(1.0-ZW) * ZN1 + ZW * ZN2
864 ZNT(I)=MIN(ZNT(I),2.85e-3)
865 ZNT(I)=MAX(ZNT(I),1.27e-7)
872 FLQC(I)=RHOX(I)*MAVAIL(I)*UST(I)*KARMAN/DENOMQ(I)
873 ! FLQC(I)=RHOX(I)*MAVAIL(I)*UST(I)*KARMAN/( &
874 ! ALOG(KARMAN*UST(I)*ZA(I)/XKA+ZA(I)/ZL)-PSIH(I))
875 DTTHX=ABS(THX(I)-THGB(I))
876 IF(DTTHX.GT.1.E-5)THEN
877 FLHC(I)=CPM(I)*RHOX(I)*UST(I)*MOL(I)/(THX(I)-THGB(I))
878 ! write(*,1001)FLHC(I),CPM(I),RHOX(I),UST(I),MOL(I),THX(I),THGB(I),I
879 1001 format(f8.5,2x,f12.7,2x,f12.10,2x,f12.10,2x,f13.10,2x,f12.8,f12.8,2x,i3)
886 !-----COMPUTE SURFACE MOIST FLUX:
888 ! IF(IDRY.EQ.1)GOTO 390
889 IF ( PRESENT(SCM_FORCE_FLUX) ) THEN
890 IF (SCM_FORCE_FLUX.EQ.1) GOTO 405
894 QFX(I)=FLQC(I)*(QSFC(I)-QX(I))
895 QFX(I)=AMAX1(QFX(I),0.)
899 !-----COMPUTE SURFACE HEAT FLUX:
903 IF(XLAND(I)-1.5.GT.0.)THEN
904 HFX(I)=FLHC(I)*(THGB(I)-THX(I))
905 ! IF ( PRESENT(ISFTCFLX) ) THEN
906 ! IF ( ISFTCFLX.NE.0 ) THEN
907 ! AHW: add dissipative heating term (commented out in 3.6.1)
908 ! HFX(I)=HFX(I)+RHOX(I)*USTM(I)*USTM(I)*WSPDI(I)
911 ELSEIF(XLAND(I)-1.5.LT.0.)THEN
912 HFX(I)=FLHC(I)*(THGB(I)-THX(I))
913 HFX(I)=AMAX1(HFX(I),-250.)
920 IF((XLAND(I)-1.5).GE.0)THEN
925 CHS(I)=UST(I)*KARMAN/DENOMQ(I)
926 ! GZ2OZ0(I)=ALOG(2./ZNT(I))
927 ! PSIM2(I)=-10.*GZ2OZ0(I)
928 ! PSIM2(I)=AMAX1(PSIM2(I),-10.)
930 CQS2(I)=UST(I)*KARMAN/DENOMQ2(I)
931 CHS2(I)=UST(I)*KARMAN/DENOMT2(I)
937 ! IF(UST(I).GE.0.1) THEN
938 ! RMOL(I)=RMOL(I)*(-FLHC(I))/(UST(I)*UST(I)*UST(I))
940 ! RMOL(I)=RMOL(I)*(-FLHC(I))/(0.1*0.1*0.1)
946 END SUBROUTINE SFCLAY1D
948 !====================================================================
949 SUBROUTINE sfclayinit( allowed_to_read )
951 LOGICAL , INTENT(IN) :: allowed_to_read
958 PSIMTB(N)=2*ALOG(0.5*(1+X))+ALOG(0.5*(1+X*X))- &
959 2.*ATAN(X)+2.*ATAN(1.)
961 PSIHTB(N)=2*ALOG(0.5*(1+Y))
964 END SUBROUTINE sfclayinit
966 !-------------------------------------------------------------------
968 END MODULE module_sf_sfclay