source: LMDZ6/branches/Amaury_dev/libf/phylmd/coare30_flux_cnrm_mod.F90 @ 5099

Last change on this file since 5099 was 5099, checked in by abarral, 4 months ago

Replace most uses of CPP_DUST by the corresponding logical defined in lmdz_cppkeys_wrapper.F90
Convert several files from .F to .f90 to allow Dust to compile w/o rrtm/ecrad
Create lmdz_yoerad.f90
(lint) Remove "!" on otherwise empty line

File size: 19.9 KB
Line 
1!SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2!SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3!SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt 
4!SFX_LIC for details. version 1.
5!     #########
6
7module coare30_flux_cnrm_mod
8  implicit none
9  private
10  public COARE30_FLUX_CNRM
11
12contains
13
14
15SUBROUTINE COARE30_FLUX_CNRM(PZ0SEA,PTA,PSST,PQA,  &
16            PVMOD,PZREF,PUREF,PPS,PQSATA,PQSAT,PSFTH,PSFTQ,PUSTAR,PCD,PCDN,PCH,PCE,PRI,&
17            PRESA,PRAIN,PPA,PZ0HSEA,LPRECIP, LPWG,coeffs )
18!     #######################################################################
19
20
21!!****  *COARE25_FLUX*
22!!
23!!    PURPOSE
24!!    -------
25!      Calculate the surface fluxes of heat, moisture, and momentum over
26!      sea surface with bulk algorithm COARE3.0.
27
28!!**  METHOD
29!!    ------
30!      transfer coefficients were obtained using a dataset which combined COARE
31!      data with those from three other ETL field experiments, and reanalysis of
32!      the HEXMAX data (DeCosmos et al. 1996).
33!      ITERMAX=3
34!      Take account of the surface gravity waves on the velocity roughness and
35!      hence the momentum transfer coefficient
36!        NGRVWAVES=0 no gravity waves action (Charnock) !default value
37!        NGRVWAVES=1 wave age parameterization of Oost et al. 2002
38!        NGRVWAVES=2 model of Taylor and Yelland 2001
39
40!!    EXTERNAL
41!!    --------
42!!
43!!    IMPLICIT ARGUMENTS
44!!    ------------------
45!!
46!!    REFERENCE
47!!    ---------
48!!      Fairall et al (2003), J. of Climate, vol. 16, 571-591
49!!      Fairall et al (1996), JGR, 3747-3764
50!!      Gosnell et al (1995), JGR, 437-442
51!!      Fairall et al (1996), JGR, 1295-1308
52!!
53!!    AUTHOR
54!!    ------
55!!     C. Lebeaupin  *Météo-France* (adapted from C. Fairall's code)
56!!
57!!    MODIFICATIONS
58!!    -------------
59!!      Original     1/06/2006
60!!      B. Decharme    06/2009 limitation of Ri
61!!      B. Decharme    09/2012 Bug in Ri calculation and limitation of Ri in surface_ri.F90
62!!      B. Decharme    06/2013 bug in z0 (output) computation
63!!      J.Escobar      06/2013  for REAL4/8 add EPSILON management
64!!      C. Lebeaupin   03/2014 bug if PTA=PSST and PEXNA=PEXNS: set a minimum value
65!!                             add abort if no convergence
66!-------------------------------------------------------------------------------
67
68!*       0.     DECLARATIONS
69!               ------------
70
71
72!USE MODD_SEAFLUX_n, ONLY : SEAFLUX_t
73
74!----------Rajout Olive ---------
75USE dimphy
76USE indice_sol_mod
77USE coare_cp_mod, ONLY: PSIFCTT=>psit_30, PSIFCTU=>psiuo
78
79!--------------------------------
80
81USE MODD_CSTS,       ONLY : XKARMAN, XG, XSTEFAN, XRD, XRV, XPI, &
82                            XLVTT, XCL, XCPD, XCPV, XRHOLW, XTT, &
83                            XP00
84
85!USE MODD_SURF_ATM,   ONLY : XVZ0CM
86
87!USE MODD_SURF_PAR,   ONLY : XUNDEF, XSURF_EPSILON
88!USE MODD_WATER_PAR
89
90!USE MODI_SURFACE_RI
91!USE MODI_WIND_THRESHOLD
92!USE MODE_COARE30_PSI
93
94!USE MODE_THERMOS
95
96
97!USE MODI_ABOR1_SFX
98
99
100!USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
101!USE PARKIND1  ,ONLY : JPRB
102
103IMPLICIT NONE
104
105!*      0.1    declarations of arguments
106
107
108
109!TYPE(SEAFLUX_t), INTENT(INOUT) :: S
110
111REAL, DIMENSION(klon), INTENT(IN)       :: PTA   ! air temperature at atm. level (K)
112REAL, DIMENSION(klon), INTENT(IN)       :: PQA   ! air humidity at atm. level (kg/kg)
113!REAL, DIMENSION(:), INTENT(IN)       :: PEXNA ! Exner function at atm. level
114!REAL, DIMENSION(:), INTENT(IN)       :: PRHOA ! air density at atm. level
115REAL, DIMENSION(klon), INTENT(IN)       :: PVMOD ! module of wind at atm. wind level (m/s)
116REAL, DIMENSION(klon), INTENT(IN)       :: PZREF ! atm. level for temp. and humidity (m)
117REAL, DIMENSION(klon), INTENT(IN)       :: PUREF ! atm. level for wind (m)
118REAL, DIMENSION(klon), INTENT(IN)       :: PSST  ! Sea Surface Temperature (K)
119!REAL, DIMENSION(:), INTENT(IN)       :: PEXNS ! Exner function at sea surface
120REAL, DIMENSION(klon), INTENT(IN)       :: PPS   ! air pressure at sea surface (Pa)
121REAL, DIMENSION(klon), INTENT(IN)       :: PRAIN !precipitation rate (kg/s/m2)
122REAL, DIMENSION(klon), INTENT(IN)       :: PPA        ! air pressure at atm level (Pa)
123REAL, DIMENSION(klon), INTENT(IN)       :: PQSATA        ! air pressure at atm level (Pa)
124
125REAL, DIMENSION(klon), INTENT(INOUT)    :: PZ0SEA! roughness length over the ocean
126
127!  surface fluxes : latent heat, sensible heat, friction fluxes
128REAL, DIMENSION(klon), INTENT(OUT)      :: PSFTH ! heat flux (W/m2)
129REAL, DIMENSION(klon), INTENT(OUT)      :: PSFTQ ! water flux (kg/m2/s)
130REAL, DIMENSION(klon), INTENT(OUT)      :: PUSTAR! friction velocity (m/s)
131
132! diagnostics
133REAL, DIMENSION(klon), INTENT(OUT)      :: PQSAT ! humidity at saturation
134REAL, DIMENSION(klon), INTENT(OUT)      :: PCD   ! heat drag coefficient
135REAL, DIMENSION(klon), INTENT(OUT)      :: PCDN  ! momentum drag coefficient
136REAL, DIMENSION(klon), INTENT(OUT)      :: PCH   ! neutral momentum drag coefficient
137REAL, DIMENSION(klon), INTENT(OUT)      :: PCE  !transfer coef. for latent heat flux
138REAL, DIMENSION(klon), INTENT(OUT)      :: PRI   ! Richardson number
139REAL, DIMENSION(klon), INTENT(OUT)      :: PRESA ! aerodynamical resistance
140REAL, DIMENSION(klon), INTENT(OUT)      :: PZ0HSEA ! heat roughness length
141
142LOGICAL,            INTENT(IN)    :: LPRECIP   !
143LOGICAL,            INTENT(IN)    :: LPWG    !
144real, dimension(3), intent(inout)      :: coeffs
145
146
147!*      0.2    declarations of local variables
148
149REAL, DIMENSION(SIZE(PTA))      :: ZVMOD    ! wind intensity
150REAL, DIMENSION(SIZE(PTA))      :: ZPA      ! Pressure at atm. level
151REAL, DIMENSION(SIZE(PTA))      :: ZTA      ! Temperature at atm. level
152REAL, DIMENSION(SIZE(PTA))      :: ZQASAT   ! specific humidity at saturation  at atm. level (kg/kg)
153
154!rajout
155REAL, DIMENSION(SIZE(PTA))       :: PEXNA      ! Exner function at atm level
156REAL, DIMENSION(SIZE(PTA))       :: PEXNS      ! Exner function at atm level
157
158REAL, DIMENSION(SIZE(PTA))      :: ZO       ! rougness length ref
159REAL, DIMENSION(SIZE(PTA))      :: ZWG      ! gustiness factor (m/s)
160
161REAL, DIMENSION(SIZE(PTA))      :: ZDU,ZDT,ZDQ,ZDUWG !differences
162
163REAL, DIMENSION(SIZE(PTA))      :: ZUSR        !velocity scaling parameter "ustar" (m/s) = friction velocity
164REAL, DIMENSION(SIZE(PTA))      :: ZTSR        !temperature sacling parameter "tstar" (degC)
165REAL, DIMENSION(SIZE(PTA))      :: ZQSR        !humidity scaling parameter "qstar" (kg/kg)
166
167REAL, DIMENSION(SIZE(PTA))      :: ZU10,ZT10   !vertical profils (10-m height)
168REAL, DIMENSION(SIZE(PTA))      :: ZVISA       !kinematic viscosity of dry air
169REAL, DIMENSION(SIZE(PTA))      :: ZO10,ZOT10  !roughness length at 10m
170REAL, DIMENSION(SIZE(PTA))      :: ZCD,ZCT,ZCC
171REAL, DIMENSION(SIZE(PTA))      :: ZCD10,ZCT10 !transfer coef. at 10m
172REAL, DIMENSION(SIZE(PTA))      :: ZRIBU,ZRIBCU
173REAL, DIMENSION(SIZE(PTA))      :: ZETU,ZL10
174
175REAL, DIMENSION(SIZE(PTA))      :: ZCHARN                      !Charnock number depends on wind module
176REAL, DIMENSION(SIZE(PTA))      :: ZTWAVE,ZHWAVE,ZCWAVE,ZLWAVE !to compute gravity waves' impact
177
178REAL, DIMENSION(SIZE(PTA))      :: ZZL,ZZTL!,ZZQL    !Obukhovs stability
179                                                     !param. z/l for u,T,q
180REAL, DIMENSION(SIZE(PTA))      :: ZRR
181REAL, DIMENSION(SIZE(PTA))      :: ZOT,ZOQ           !rougness length ref
182REAL, DIMENSION(SIZE(PTA))      :: ZPUZ,ZPTZ,ZPQZ    !PHI funct. for u,T,q
183
184REAL, DIMENSION(SIZE(PTA))      :: ZBF               !constants to compute gustiness factor
185
186REAL, DIMENSION(SIZE(PTA))      :: ZTAU       !momentum flux (W/m2)
187REAL, DIMENSION(SIZE(PTA))      :: ZHF        !sensible heat flux (W/m2)
188REAL, DIMENSION(SIZE(PTA))      :: ZEF        !latent heat flux (W/m2)
189REAL, DIMENSION(SIZE(PTA))      :: ZWBAR      !diag for webb correction but not used here after
190REAL, DIMENSION(SIZE(PTA))      :: ZTAUR      !momentum flux due to rain (W/m2)
191REAL, DIMENSION(SIZE(PTA))      :: ZRF        !sensible heat flux due to rain (W/m2)
192REAL, DIMENSION(SIZE(PTA))      :: ZCHN,ZCEN  !neutral coef. for heat and vapor
193
194REAL, DIMENSION(SIZE(PTA))      :: ZLV      !latent heat constant
195
196REAL, DIMENSION(SIZE(PTA))      :: ZTAC,ZDQSDT,ZDTMP,ZDWAT,ZALFAC ! for precipitation impact
197REAL, DIMENSION(SIZE(PTA))      :: ZXLR                           ! vaporisation  heat  at a given temperature
198REAL, DIMENSION(SIZE(PTA))      :: ZCPLW                          ! specific heat for water at a given temperature
199
200REAL, DIMENSION(SIZE(PTA))      :: ZUSTAR2  ! square of friction velocity
201
202REAL, DIMENSION(SIZE(PTA))      :: ZDIRCOSZW! orography slope cosine (=1 on water!)
203REAL, DIMENSION(SIZE(PTA))      :: ZAC      ! Aerodynamical conductance
204
205
206INTEGER, DIMENSION(SIZE(PTA))   :: ITERMAX             ! maximum number of iterations
207
208REAL    :: ZRVSRDM1,ZRDSRV,ZR2 ! thermodynamic constants
209REAL    :: ZBETAGUST           !gustiness factor
210REAL    :: ZZBL                !atm. boundary layer depth (m)
211REAL    :: ZVISW               !m2/s kinematic viscosity of water
212REAL    :: ZS                  !height of rougness length ref
213REAL    :: ZCH10               !transfer coef. at 10m
214
215REAL    :: QSAT_SEAWATER
216REAL    :: QSATSEAW_1D
217
218INTEGER :: J, JLOOP    !loop indice
219!REAL(KIND=JPRB) :: ZHOOK_HANDLE
220
221!--------- Modif Olive -----------------
222REAL, DIMENSION(SIZE(PTA))        :: PRHOA
223REAL, PARAMETER                   :: XUNDEF = 1.E+20
224
225REAL       :: XVCHRNK = 0.021
226REAL       :: XVZ0CM = 1.0E-5
227!REAL       :: XRIMAX
228
229
230INTEGER :: PREF             ! reference pressure for exner function
231INTEGER :: NGRVWAVES        ! Pour le choix du z0
232
233INCLUDE "YOMCST.h"
234INCLUDE "clesphys.h"
235
236!--------------------------------------
237
238
239PRHOA(:) = PPS(:) / (287.1 * PTA(:) * (1.+.61*PQA(:)))
240
241PREF = 100000.                     ! = 1000 hPa
242NGRVWAVES = 1
243
244PEXNA = (PPA/PREF)**(RD/RCPD)
245PEXNS = (PPS/PREF)**(RD/RCPD)
246
247!-------------------------------------------------------------------------------
248
249!       1.     Initializations
250!              ---------------
251
252!       1.1   Constants and parameters
253
254!IF (LHOOK) CALL DR_HOOK('COARE30_FLUX',0,ZHOOK_HANDLE)
255
256ZRVSRDM1  = XRV/XRD-1. ! 0.607766
257ZRDSRV    = XRD/XRV    ! 0.62198
258ZR2       = 1.-ZRDSRV  ! pas utilisé dans cette routine
259ZBETAGUST = 1.2        ! value based on TOGA-COARE experiment
260ZZBL      = 600.       ! Set a default value for boundary layer depth
261ZS        = 10.        ! Standard heigth =10m
262ZCH10     = 0.00115
263
264ZVISW     = 1.E-6
265
266!       1.2   Array initialization by undefined values
267
268PSFTH (:)=XUNDEF
269PSFTQ (:)=XUNDEF
270PUSTAR(:)=XUNDEF
271
272PCD(:) = XUNDEF
273PCDN(:) = XUNDEF
274PCH(:) = XUNDEF
275PCE(:) =XUNDEF
276PRI(:) = XUNDEF
277
278PRESA(:)=XUNDEF
279
280!-------------------------------------------------------------------------------
281!       2. INITIAL GUESS FOR THE ITERATIVE METHOD
282!          -------------------------------------
283
284!       2.0     Temperature
285
286! Set a non-zero value for the temperature gradient
287
288WHERE((PTA(:)*PEXNS(:)/PEXNA(:)-PSST(:))==0.)
289      ZTA(:)=PTA(:)-1E-3
290ELSEWHERE
291      ZTA(:)=PTA(:)
292ENDWHERE
293
294!       2.1     Wind and humidity
295
296! Sea surface specific humidity
297
298!PQSAT(:)=QSAT_SEAWATER(PSST(:),PPS(:))
299PQSAT(:)=QSATSEAW_1D(PSST(:),PPS(:))
300
301! Set a minimum value to wind
302
303!ZVMOD(:) = WIND_THRESHOLD(PVMOD(:),PUREF(:))
304
305
306ZVMOD = MAX(PVMOD , 0.1 * MIN(10.,PUREF) )    !set a minimum value to wind
307!ZVMOD = PVMOD    !set a minimum value to wind
308
309! Specific humidity at saturation at the atm. level
310
311ZPA(:) = XP00* (PEXNA(:)**(XCPD/XRD))
312!ZQASAT(:) = QSAT_SEAWATER(ZTA(:),ZPA(:))
313ZQASAT = QSATSEAW_1D(ZTA(:),ZPA(:))
314
315
316ZO(:)  = 0.0001
317ZWG(:) = 0.
318IF (LPWG) ZWG(:) = 0.5
319
320ZCHARN(:) = 0.011
321
322DO J=1,SIZE(PTA)
323
324  !      2.2       initial guess
325
326  ZDU(J) = ZVMOD(J)   !wind speed difference with surface current(=0) (m/s)
327                      !initial guess for gustiness factor
328  ZDT(J) = -(ZTA(J)/PEXNA(J)) + (PSST(J)/PEXNS(J)) !potential temperature difference
329  ZDQ(J) = PQSAT(J)-PQA(J)                         !specific humidity difference
330
331  ZDUWG(J) = SQRT(ZDU(J)**2+ZWG(J)**2)     !wind speed difference including gustiness ZWG
332
333  !      2.3   initialization of neutral coefficients
334
335  ZU10(J)  = ZDUWG(J)*LOG(ZS/ZO(J))/LOG(PUREF(J)/ZO(J))
336  ZUSR(J)  = 0.035*ZU10(J)
337  ZVISA(J) = 1.326E-5*(1.+6.542E-3*(ZTA(J)-XTT)+&
338             8.301E-6*(ZTA(J)-XTT)**2-4.84E-9*(ZTA(J)-XTT)**3) !Andrea (1989) CRREL Rep. 89-11
339
340  ZO10(J) = ZCHARN(J)*ZUSR(J)*ZUSR(J)/XG+0.11*ZVISA(J)/ZUSR(J)
341  ZCD(J)  = (XKARMAN/LOG(PUREF(J)/ZO10(J)))**2  !drag coefficient
342  ZCD10(J)= (XKARMAN/LOG(ZS/ZO10(J)))**2
343  ZCT10(J)= ZCH10/SQRT(ZCD10(J))
344  ZOT10(J)= ZS/EXP(XKARMAN/ZCT10(J))
345
346  !-------------------------------------------------------------------------------
347  !             Grachev and Fairall (JAM, 1997)
348  ZCT(J) = XKARMAN/LOG(PZREF(J)/ZOT10(J))      !temperature transfer coefficient
349  ZCC(J) = XKARMAN*ZCT(J)/ZCD(J)               !z/L vs Rib linear coef.
350
351  ZRIBCU(J) = -PUREF(J)/(ZZBL*0.004*ZBETAGUST**3) !saturation or plateau Rib
352  !ZRIBU(J) =-XG*PUREF(J)*(ZDT(J)+ZRVSRDM1*(ZTA(J)-XTT)*ZDQ)/&
353  !     &((ZTA(J)-XTT)*ZDUWG(J)**2)
354  ZRIBU(J)  = -XG*PUREF(J)*(ZDT(J)+ZRVSRDM1*ZTA(J)*ZDQ(J))/&
355               (ZTA(J)*ZDUWG(J)**2)
356
357  IF (ZRIBU(J)<0.) THEN
358    ZETU(J) = ZCC(J)*ZRIBU(J)/(1.+ZRIBU(J)/ZRIBCU(J))    !Unstable G and F
359  ELSE
360    ZETU(J) = ZCC(J)*ZRIBU(J)/(1.+27./9.*ZRIBU(J)/ZCC(J))!Stable
361  ENDIF
362
363  ZL10(J) = PUREF(J)/ZETU(J) !MO length
364
365ENDDO
366
367!  First guess M-O stability dependent scaling params. (u*,T*,q*) to estimate ZO and z/L (ZZL)
368ZUSR(:) = ZDUWG(:)*XKARMAN/(LOG(PUREF(:)/ZO10(:))-PSIFCTU(PUREF(1)/ZL10(1)))
369ZTSR(:) = -ZDT(:)*XKARMAN/(LOG(PZREF(:)/ZOT10(:))-PSIFCTT(PZREF(1)/ZL10(1)))
370ZQSR(:) = -ZDQ(:)*XKARMAN/(LOG(PZREF(:)/ZOT10(:))-PSIFCTT(PZREF(1)/ZL10(1)))
371
372ZZL(:) = 0.0
373
374DO J=1,SIZE(PTA)
375
376  IF (ZETU(J)>50.) THEN
377    ITERMAX(J) = 1
378  ELSE
379    ITERMAX(J) = 3 !number of iterations
380  ENDIF
381
382  !then modify Charnork for high wind speeds Chris Fairall's data
383  IF (ZDUWG(J)>10.) ZCHARN(J) = 0.011 + (0.018-0.011)*(ZDUWG(J)-10.)/(18.-10.)
384  IF (ZDUWG(J)>18.) ZCHARN(J) = 0.018
385
386  !                3.  ITERATIVE LOOP TO COMPUTE USR, TSR, QSR
387  !                -------------------------------------------
388
389  ZHWAVE(J) = 0.018*ZVMOD(J)*ZVMOD(J)*(1.+0.015*ZVMOD(J))
390  ZTWAVE(J) = 0.729*ZVMOD(J)
391  ZCWAVE(J) = XG*ZTWAVE(J)/(2.*XPI)
392  ZLWAVE(J) = ZTWAVE(J)*ZCWAVE(J)
393
394ENDDO
395
396DO JLOOP=1,MAXVAL(ITERMAX) ! begin of iterative loop
397
398  DO J=1,SIZE(PTA)
399
400    IF (JLOOP>ITERMAX(J)) CYCLE
401
402    IF (NGRVWAVES==0) THEN
403      ZO(J) = ZCHARN(J)*ZUSR(J)*ZUSR(J)/XG + 0.11*ZVISA(J)/ZUSR(J) !Smith 1988
404    ELSE IF (NGRVWAVES==1) THEN
405      ZO(J) = (50./(2.*XPI))*ZLWAVE(J)*(ZUSR(J)/ZCWAVE(J))**4.5 &
406              + 0.11*ZVISA(J)/ZUSR(J)                       !Oost et al. 2002
407    ELSE IF (NGRVWAVES==2) THEN
408      ZO(J) = 1200.*ZHWAVE(J)*(ZHWAVE(J)/ZLWAVE(J))**4.5 &
409              + 0.11*ZVISA(J)/ZUSR(J)                       !Taulor and Yelland 2001
410    ENDIF
411
412    ZRR(J) = ZO(J)*ZUSR(J)/ZVISA(J)
413    ZOQ(J) = MIN(1.15E-4 , 5.5E-5/ZRR(J)**0.6)
414    ZOT(J) = ZOQ(J)
415
416    ZZL(J) = XKARMAN * XG * PUREF(J) * &
417              ( ZTSR(J)*(1.+ZRVSRDM1*PQA(J)) + ZRVSRDM1*ZTA(J)*ZQSR(J) ) / &
418              ( ZTA(J)*ZUSR(J)*ZUSR(J)*(1.+ZRVSRDM1*PQA(J)) )
419    ZZTL(J)= ZZL(J)*PZREF(J)/PUREF(J)  ! for T
420!    ZZQL(J)=ZZL(J)*PZREF(J)/PUREF(J)  ! for Q
421  ENDDO
422
423  ZPUZ(:) = PSIFCTU(ZZL(1))
424  ZPTZ(:) = PSIFCTT(ZZTL(1))
425
426  DO J=1,SIZE(PTA)
427
428    ! ZPQZ(J)=PSIFCTT(ZZQL(J))
429    ZPQZ(J) = ZPTZ(J)
430
431    !             3.1 scale parameters
432
433    ZUSR(J) = ZDUWG(J)*XKARMAN/(LOG(PUREF(J)/ZO(J)) -ZPUZ(J))
434    ZTSR(J) = -ZDT(J)  *XKARMAN/(LOG(PZREF(J)/ZOT(J))-ZPTZ(J))
435    ZQSR(J) = -ZDQ(J)  *XKARMAN/(LOG(PZREF(J)/ZOQ(J))-ZPQZ(J))
436
437    !             3.2 Gustiness factor (ZWG)
438
439    IF(LPWG) THEN
440      ZBF(J) = -XG/ZTA(J)*ZUSR(J)*(ZTSR(J)+ZRVSRDM1*ZTA(J)*ZQSR(J))
441      IF (ZBF(J)>0.) THEN
442        ZWG(J) = ZBETAGUST*(ZBF(J)*ZZBL)**(1./3.)
443      ELSE
444        ZWG(J) = 0.2
445      ENDIF
446    ENDIF
447    ZDUWG(J) = SQRT(ZVMOD(J)**2 + ZWG(J)**2)
448
449  ENDDO
450
451ENDDO
452!-------------------------------------------------------------------------------
453
454!            4.  COMPUTE transfer coefficients PCD, PCH, ZCE and SURFACE FLUXES
455!                --------------------------------------------------------------
456
457ZTAU(:) = XUNDEF
458ZHF(:)  = XUNDEF
459ZEF(:)  = XUNDEF
460
461ZWBAR(:) = 0.
462ZTAUR(:) = 0.
463ZRF(:)   = 0.
464
465DO J=1,SIZE(PTA)
466
467
468  !            4. transfert coefficients PCD, PCH and PCE
469  !                 and neutral PCDN, ZCHN, ZCEN
470
471  PCD(J) = (ZUSR(J)/ZDUWG(J))**2.
472  PCH(J) = ZUSR(J)*ZTSR(J)/(ZDUWG(J)*(ZTA(J)*PEXNS(J)/PEXNA(J)-PSST(J)))
473  PCE(J) = ZUSR(J)*ZQSR(J)/(ZDUWG(J)*(PQA(J)-PQSAT(J)))
474
475  PCDN(J) = (XKARMAN/LOG(ZS/ZO(J)))**2.
476  ZCHN(J) = (XKARMAN/LOG(ZS/ZO(J)))*(XKARMAN/LOG(ZS/ZOT(J)))
477  ZCEN(J) = (XKARMAN/LOG(ZS/ZO(J)))*(XKARMAN/LOG(ZS/ZOQ(J)))
478
479  ZLV(J) = XLVTT + (XCPV-XCL)*(PSST(J)-XTT)
480
481  !            4. 2 surface fluxes
482
483  IF (ABS(PCDN(J))>1.E-2) THEN   !!!! secure COARE3.0 CODE
484    write(*,*) 'pb PCDN in COARE30: ',PCDN(J)
485    write(*,*) 'point: ',J,"/",SIZE(PTA)
486    write(*,*) 'roughness: ', ZO(J)
487    write(*,*) 'ustar: ',ZUSR(J)
488    write(*,*) 'wind: ',ZDUWG(J)
489    CALL abort_physic('COARE30',': PCDN too large -> no convergence',1)
490  ELSE
491    ZTSR(J) = -ZTSR(J)
492    ZQSR(J) = -ZQSR(J)
493    ZTAU(J) = -PRHOA(J)*ZUSR(J)*ZUSR(J)*ZVMOD(J)/ZDUWG(J)
494    ZHF(J)  =  PRHOA(J)*XCPD*ZUSR(J)*ZTSR(J)
495    ZEF(J)  =  PRHOA(J)*ZLV(J)*ZUSR(J)*ZQSR(J)
496
497    !           4.3 Contributions to surface  fluxes due to rainfall
498
499    ! SB: a priori, le facteur ZRDSRV=XRD/XRV est introduit pour
500    !     adapter la formule de Clausius-Clapeyron (pour l'air
501    !     sec) au cas humide.
502    IF (LPRECIP) THEN
503
504      ! heat surface  fluxes
505
506      ZTAC(J)  = ZTA(J)-XTT
507
508      ZXLR(J)  = XLVTT + (XCPV-XCL)* ZTAC(J)                            ! latent heat of rain vaporization
509      ZDQSDT(J)= ZQASAT(J) * ZXLR(J) / (XRD*ZTA(J)**2)                  ! Clausius-Clapeyron relation
510      ZDTMP(J) = (1.0 + 3.309e-3*ZTAC(J) -1.44e-6*ZTAC(J)*ZTAC(J)) * &  !heat diffusivity
511                  0.02411 / (PRHOA(J)*XCPD)
512
513      ZDWAT(J) = 2.11e-5 * (XP00/ZPA(J)) * (ZTA(J)/XTT)**1.94           ! water vapour diffusivity from eq (13.3)
514      !                                                                 ! of Pruppacher and Klett (1978)
515      ZALFAC(J)= 1.0 / (1.0 + &                                         ! Eq.11 in GoF95
516                   ZRDSRV*ZDQSDT(J)*ZXLR(J)*ZDWAT(J)/(ZDTMP(J)*XCPD))   ! ZALFAC=wet-bulb factor (sans dim)
517      ZCPLW(J) = 4224.8482 + ZTAC(J) * &
518                              ( -4.707 + ZTAC(J) * &
519                                (0.08499 + ZTAC(J) * &
520                                  (1.2826e-3 + ZTAC(J) * &
521                                    (4.7884e-5 - 2.0027e-6* ZTAC(J))))) ! specific heat
522
523      ZRF(J)   = PRAIN(J) * ZCPLW(J) * ZALFAC(J) * &                    !Eq.12 in GoF95 !SIGNE?
524                   (PSST(J) - ZTA(J) + (PQSAT(J)-PQA(J))*ZXLR(J)/XCPD )
525
526      ! Momentum flux due to rainfall
527
528      ZTAUR(J)=-0.85*(PRAIN(J) *ZVMOD(J)) !pp3752 in FBR96
529
530    ENDIF
531
532    !             4.4   Webb correction to latent heat flux
533
534    ZWBAR(J)=- (1./ZRDSRV)*ZUSR(J)*ZQSR(J) / (1.0+(1./ZRDSRV)*PQA(J)) &
535               - ZUSR(J)*ZTSR(J)/ZTA(J)                        ! Eq.21*rhoa in FBR96
536
537    !             4.5   friction velocity which contains correction du to rain
538
539    ZUSTAR2(J)= - (ZTAU(J) + ZTAUR(J)) / PRHOA(J)
540    PUSTAR(J) =  SQRT(ZUSTAR2(J))
541
542    !             4.6   Total surface fluxes
543
544    PSFTH (J) =  ZHF(J) + ZRF(J)
545    PSFTQ (J) =  ZEF(J) / ZLV(J)
546
547  ENDIF
548ENDDO
549
550
551coeffs = [PCD,&
552       PCE,&
553       PCH]
554
555!-------------------------------------------------------------------------------
556
557!       5.  FINAL STEP : TOTAL SURFACE FLUXES AND DERIVED DIAGNOSTICS
558!           -----------
559!       5.1    Richardson number
560
561
562!------------STOP LA --------------------
563!ZDIRCOSZW(:) = 1.
564! CALL SURFACE_RI(PSST,PQSAT,PEXNS,PEXNA,ZTA,ZQASAT,&
565!                PZREF,PUREF,ZDIRCOSZW,PVMOD,PRI   )
566!!
567!!       5.2     Aerodynamical conductance and resistance
568!!
569!ZAC(:) = PCH(:)*ZVMOD(:)
570!PRESA(:) = 1. / MAX(ZAC(:),XSURF_EPSILON)
571
572!!       5.3 Z0 and Z0H over sea
573!!
574!PZ0SEA(:) =  ZCHARN(:) * ZUSTAR2(:) / XG + XVZ0CM * PCD(:) / PCDN(:)
575!!
576!!PZ0HSEA(:) = PZ0SEA(:)
577!!
578!IF (LHOOK) CALL DR_HOOK('COARE30_FLUX',1,ZHOOK_HANDLE)
579
580!-------------------------------------------------------------------------------
581
582END SUBROUTINE COARE30_FLUX_CNRM
583
584end module coare30_flux_cnrm_mod
Note: See TracBrowser for help on using the repository browser.