Newer
Older
!MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
!MNH_LIC for details. version 1.
! ################
MODULE MODI_TURB
! ################
!
INTERFACE
!
SUBROUTINE TURB(KKA, KKU, KKL, KMI,KRR,KRRL,KRRI,HLBCX,HLBCY, &
KSPLIT,KMODEL_CL, &
OCLOSE_OUT,OTURB_FLX,OTURB_DIAG,OSUBG_COND,ORMC01, &
HTURBDIM,HTURBLEN,HTOM,HTURBLEN_CL,PIMPL, &
PTSTEP,HFMFILE,HLUOUT,PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, &
PDIRCOSXW,PDIRCOSYW,PDIRCOSZW,PCOSSLOPE,PSINSLOPE, &
PRHODJ,PTHVREF,PRHODREF, &
PSFTH,PSFRV,PSFSV,PSFU,PSFV, &
PCEI,PCEI_MIN,PCEI_MAX,PCOEF_AMPL_SAT, &
PTHLT,PRT, &
PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS,PRTKES,PRTKEMS,PSIGS,&
PFLXZTHVMF,PWTH,PWRC,PWSV,PDYP,PTHP,PTR,PDISS,PLEM )
!
INTEGER, INTENT(IN) :: KKA !near ground array index
INTEGER, INTENT(IN) :: KKU !uppest atmosphere array index
INTEGER, INTENT(IN) :: KKL !vert. levels type 1=MNH -1=AR
INTEGER, INTENT(IN) :: KMI ! model index number
INTEGER, INTENT(IN) :: KRR ! number of moist var.
INTEGER, INTENT(IN) :: KRRL ! number of liquid water var.
INTEGER, INTENT(IN) :: KRRI ! number of ice water var.
CHARACTER(LEN=*),DIMENSION(:),INTENT(IN):: HLBCX, HLBCY ! X- and Y-direc LBC
INTEGER, INTENT(IN) :: KSPLIT ! number of time-splitting
INTEGER, INTENT(IN) :: KMODEL_CL ! model number for cloud mixing length
LOGICAL, INTENT(IN) :: OCLOSE_OUT ! switch for syncronous
! file opening
LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the
! turbulent fluxes in the syncronous FM-file
LOGICAL, INTENT(IN) :: OTURB_DIAG ! switch to write some
! diagnostic fields in the syncronous FM-file
LOGICAL, INTENT(IN) :: OSUBG_COND ! switch for SUBGrid
! CONDensation
LOGICAL, INTENT(IN) :: ORMC01 ! switch for RMC01 lengths in SBL
CHARACTER*4 , INTENT(IN) :: HTURBDIM ! dimensionality of the
! turbulence scheme
CHARACTER*4 , INTENT(IN) :: HTURBLEN ! kind of mixing length
CHARACTER*4 , INTENT(IN) :: HTOM ! kind of Third Order Moment
CHARACTER*4 , INTENT(IN) :: HTURBLEN_CL ! kind of cloud mixing length
! surface friction flux
REAL, INTENT(IN) :: PIMPL ! degree of implicitness
CHARACTER(LEN=*), INTENT(IN) :: HFMFILE ! Name of the output
! FM-file
CHARACTER(LEN=*), INTENT(IN) :: HLUOUT ! Output-listing name for
! model n
!
REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX,PDYY,PDZZ,PDZX,PDZY
! metric coefficients
REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! physical distance
! between 2 succesive grid points along the K direction
REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW, PDIRCOSZW
! Director Cosinus along x, y and z directions at surface w-point
REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle
! between i and the slope vector
REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle
! between i and the slope vector
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry density * Grid size
REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! Virtual Potential
! Temperature of the reference state
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! dry density of the
! reference state
!
REAL, DIMENSION(:,:), INTENT(IN) :: PSFTH,PSFRV, &
! normal surface fluxes of theta and Rv
PSFU,PSFV
! normal surface fluxes of (u,v) parallel to the orography
REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSV
! normal surface fluxes of Scalar var.
!
! prognostic variables at t- deltat
REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! Pressure at time t
REAL, DIMENSION(:,:,:), INTENT(IN) :: PUT,PVT,PWT ! wind components
REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKET ! TKE
REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVT ! passive scal. var.
REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCT ! Second-order flux
! s'rc'/2Sigma_s2 at time t-1 multiplied by Lambda_3
REAL, DIMENSION(:,:), INTENT(INOUT) :: PBL_DEPTH ! BL depth for TOMS
REAL, DIMENSION(:,:), INTENT(INOUT) :: PSBL_DEPTH ! SBL depth for RMC01
!
!
! variables for cloud mixing length
REAL, DIMENSION(:,:,:), INTENT(IN) :: PCEI ! Cloud Entrainment instability
! index to emphasize localy
! turbulent fluxes
REAL, INTENT(IN) :: PCEI_MIN ! minimum threshold for the instability index CEI
REAL, INTENT(IN) :: PCEI_MAX ! maximum threshold for the instability index CEI
REAL, INTENT(IN) :: PCOEF_AMPL_SAT ! saturation of the amplification coefficient
! thermodynamical variables which are transformed in conservative var.
REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTHLT ! conservative pot. temp.
REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRT ! water var. where
! PRT(:,:,:,1) is the conservative mixing ratio
!
! sources of momentum, conservative potential temperature, Turb. Kin. Energy,
! TKE dissipation
REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS,PRVS,PRWS,PRTHLS,PRTKES
! Source terms for all water kinds, PRRS(:,:,:,1) is used for the conservative
! mixing ratio
REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS
! Source terms for all passive scalar variables
REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS
! Sigma_s at time t+1 : square root of the variance of the deviation to the
! saturation
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSIGS
REAL, DIMENSION(:,:,:), INTENT(IN) :: PFLXZTHVMF
! MF contribution for vert. turb. transport
! used in the buoy. prod. of TKE
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWTH ! heat flux
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWRC ! cloud water flux
REAL, DIMENSION(:,:,:,:),INTENT(OUT) :: PWSV ! scalar flux
REAL, DIMENSION(:,:,:), INTENT(INOUT):: PDYP ! Dynamical production of TKE
REAL, DIMENSION(:,:,:), INTENT(INOUT):: PTHP ! Thermal production of TKE
REAL, DIMENSION(:,:,:), INTENT(OUT):: PTR ! Transport production of TKE
REAL, DIMENSION(:,:,:), INTENT(OUT):: PDISS ! Dissipation of TKE
REAL, DIMENSION(:,:,:), INTENT(INOUT):: PLEM ! Mixing length
!
!-------------------------------------------------------------------------------
!
END SUBROUTINE TURB
!
END INTERFACE
!
END MODULE MODI_TURB
!
! #################################################################
SUBROUTINE TURB(KKA,KKU,KKL,KMI,KRR,KRRL,KRRI,HLBCX,HLBCY,KSPLIT,KMODEL_CL, &
OCLOSE_OUT,OTURB_FLX,OTURB_DIAG,OSUBG_COND,ORMC01, &
HTURBDIM,HTURBLEN,HTOM,HTURBLEN_CL,PIMPL, &
PTSTEP,HFMFILE,HLUOUT,PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, &
PDIRCOSXW,PDIRCOSYW,PDIRCOSZW,PCOSSLOPE,PSINSLOPE, &
PRHODJ,PTHVREF,PRHODREF, &
PSFTH,PSFRV,PSFSV,PSFU,PSFV, &
PCEI,PCEI_MIN,PCEI_MAX,PCOEF_AMPL_SAT, &
PTHLT,PRT, &
PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS,PRTKES,PRTKEMS,PSIGS,&
PFLXZTHVMF,PWTH,PWRC,PWSV,PDYP,PTHP,PTR,PDISS,PLEM )
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
! #################################################################
!
!
!!**** *TURB* - computes the turbulent source terms for the prognostic
!! variables.
!!
!! PURPOSE
!! -------
!!**** The purpose of this routine is to compute the source terms in
!! the evolution equations due to the turbulent mixing.
!! The source term is computed as the divergence of the turbulent fluxes.
!! The cartesian fluxes are obtained by a one and a half order closure, based
!! on a prognostic equation for the Turbulence Kinetic Energy( TKE ). The
!! system is closed by prescribing a turbulent mixing length. Different
!! choices are available for this length.
!
!!** METHOD
!! ------
!!
!! The dimensionality of the turbulence parameterization can be chosen by
!! means of the parameter HTURBDIM:
!! * HTURBDIM='1DIM' the parameterization is 1D but can be used in
!! 3D , 2D or 1D simulations. Only the sources associated to the vertical
!! turbulent fluxes are taken into account.
!! * HTURBDIM='3DIM' the parameterization is fully 2D or 3D depending
!! on the model dimensionality. Of course, it does not make any sense to
!! activate this option with a 1D model.
!!
!! The following steps are made:
!! 1- Preliminary computations.
!! 2- The metric coefficients are recovered from the grid knowledge.
!! 3- The mixing length is computed according to its choice:
!! * HTURBLEN='BL89' the Bougeault and Lacarrere algorithm is used.
!! The mixing length is given by the vertical displacement from its
!! original level of an air particule having an initial internal
!! energy equal to its TKE and stopped by the buoyancy forces.
!! The discrete formulation is second order accurate.
!! * HTURBLEN='DELT' the mixing length is given by the mesh size
!! depending on the model dimensionality, this length is limited
!! with the ground distance.
!! * HTURBLEN='DEAR' the mixing length is given by the mesh size
!! depending on the model dimensionality, this length is limited
!! with the ground distance and also by the Deardorff mixing length
!! pertinent in the stable cases.
!! * HTURBLEN='KEPS' the mixing length is deduced from the TKE
!! dissipation, which becomes a prognostic variable of the model (
!! Duynkerke formulation).
!! 3'- The cloud mixing length is computed according to HTURBLEN_CLOUD
!! and emphasized following the CEI index
!! 4- The conservative variables are computed along with Lv/Cp.
!! 5- The turbulent Prandtl numbers are computed from the resolved fields
!! and TKE
!! 6- The sources associated to the vertical turbulent fluxes are computed
!! with a temporal scheme allowing a degree of implicitness given by
!! PIMPL, varying from PIMPL=0. ( purely explicit scheme) to PIMPL=1.
!! ( purely implicit scheme)
!! The sources associated to the horizontal fluxes are computed with a
!! purely explicit temporal scheme. These sources are only computed when
!! the turbulence parameterization is 2D or 3D( HTURBDIM='3DIM' ).
!! 7- The sources for TKE are computed, along with the dissipation of TKE
!! if HTURBLEN='KEPS'.
!! 8- Some turbulence-related quantities are stored in the synchronous
!! FM-file.
!! 9- The non-conservative variables are retrieved.
!!
!!
!! The saving of the fields in the synchronous FM-file is controlled by:
!! * OTURB_FLX => saves all the turbulent fluxes and correlations
!! * OTURB_DIAG=> saves the turbulent Prandtl and Schmidt numbers, the
!! source terms of TKE and dissipation of TKE
!!
!! EXTERNAL
!! --------
!! SUBROUTINE PRANDTL : computes the turbulent Prandtl number
!! SUBROUTINE TURB_VER : computes the sources from the vertical fluxes
!! SUBROUTINE TURB_HOR : computes the sources from the horizontal fluxes
!! SUBROUTINE TKE_EPS_SOURCES : computes the sources for TKE and its
!! dissipation
!! SUBROUTINE BUDGET : computes and stores the budgets
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!!
!! MODD_PARAMETERS : JPVEXT number of marginal vertical points
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
!!
!! MODD_CONF : CCONF model configuration (start/restart)
!! L1D switch for 1D model version
!! L2D switch for 2D model version
!!
!! MODD_CST : contains physical constants
!! XG gravity constant
!! XRD Gas constant for dry air
!! XRV Gas constant for vapor
!!
!! MODD_CTURB : contains turbulence scheme constants
!! XCMFS,XCED to compute the dissipation mixing length
!! XTKEMIN minimum values for the TKE
!! XLINI,XLINF to compute Bougeault-Lacarrere mixing
!! length
!! Module MODD_BUDGET:
!! NBUMOD
!! CBUTYPE
!! NBUPROCCTR
!! LBU_RU
!! LBU_RV
!! LBU_RW
!! LBU_RTH
!! LBU_RSV1
!! LBU_RRV
!! LBU_RRC
!! LBU_RRR
!! LBU_RRI
!! LBU_RRS
!! LBU_RRG
!! LBU_RRH
!!
!! REFERENCE
!! ---------
!! Book 2 of documentation (routine TURB)
!! Book 1 of documentation (Chapter: Turbulence)
!!
!! AUTHOR
!! ------
!! Joan Cuxart * INM and Meteo-France *
!!
!! MODIFICATIONS
!! -------------
!! Original 05/10/94
!! Modifications: Feb 14, 1995 (J.Cuxart and J.Stein)
!! Doctorization and Optimization
!! Modifications: March 21, 1995 (J.M. Carriere)
!! Introduction of cloud water
!! Modifications: June 1, 1995 (J.Cuxart )
!! take min(Kz,delta)
!! Modifications: June 1, 1995 (J.Stein J.Cuxart)
!! remove unnecessary arrays and change Prandtl
!! and Schmidt numbers localizations
!! Modifications: July 20, 1995 (J.Stein) remove MODI_ground_ocean +
!! TZDTCUR + MODD_TIME because they are not used
!! change RW in RNP for the outputs
!! Modifications: August 21, 1995 (Ph. Bougeault)
!! take min(K(z-zsol),delta)
!! Modifications: Sept 14, 1995 (Ph Bougeault, J. Cuxart)
!! second order BL89 mixing length computations + add Deardorff length
!! in the Delta case for stable cases
!! Modifications: Sept 19, 1995 (J. Stein, J. Cuxart)
!! define a DEAR case for the mixing length, add MODI_BUDGET and change
!! some BUDGET calls, add LES tools
!! Modifications: Oct 16, 1995 (J. Stein) change the budget calls
!! Modifications: Feb 28, 1996 (J. Stein) optimization +
!! remove min(K(z-zsol),delta)+
!! bug in the tangential fluxes
!! Modifications: Oct 16, 1996 (J. Stein) change the subgrid condensation
!! scheme + temporal discretization
!! Modifications: Dec 19, 1996 (J.-P. Pinty) update the budget calls
!! Jun 22, 1997 (J. Stein) use the absolute pressure and
!! change the Deardorf length at the surface
!! Modifications: Apr 27, 1997 (V. Masson) BL89 mix. length computed in
!! a separate routine
!! Oct 13, 1999 (J. Stein) switch for the tgt fluxes
!! Jun 24, 1999 (P Jabouille) Add routine UPDATE_ROTATE_WIND
!! Feb 15, 2001 (J. Stein) remove tgt fluxes
!! Mar 8, 2001 (V. Masson) forces the same behaviour near the surface
!! for all mixing lengths
!! Nov 06, 2002 (V. Masson) LES budgets
!! Nov, 2002 (V. Masson) implement modifications of
!! mixing and dissipative lengths
!! near the surface (according
!! Redelsperger et al 2001)
!! Apr, 2003 (V. Masson) bug in Blackadar length
!! bug in LES in 1DIM case
!! Feb 20, 2003 (J.-P. Pinty) Add reversible ice processes
!! May,26 2004 (P Jabouille) coef for computing dissipative heating
!! Sept 2004 (M.Tomasini) Cloud Mixing length modification
!! following the instability
!! criterium CEI calculated in modeln
!! May 2006 Remove KEPS
!! Sept.2006 (I.Sandu): Modification of the stability criterion for
!! DEAR (theta_v -> theta_l)
!! Oct 2007 (J.Pergaud) Add MF contribution for vert. turb. transport
!! Oct.2009 (C.Lac) Introduction of different PTSTEP according to the
!! advection schemes
!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after
!! change of YCOMMENT
!! 06/2011 (J.escobar ) Bypass Bug with ifort11/12 on HLBCX,HLBC
!! 2012-02 Y. Seity, add possibility to run with reversed
!! vertical levels
!! 10/2012 (J. Colin) Correct bug in DearDoff for dry simulations
!! 10/2012 J.Escobar Bypass PGI bug , redefine some allocatable array inplace of automatic
!! --------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
USE MODD_PARAMETERS, ONLY: JPVEXT_TURB
USE MODD_CST
USE MODD_CTURB
USE MODD_CONF
USE MODD_BUDGET
USE MODD_LES
USE MODD_NSV
!
USE MODI_BL89
USE MODI_TURB_VER
USE MODI_ROTATE_WIND
USE MODI_TURB_HOR_SPLT
USE MODI_TKE_EPS_SOURCES
USE MODI_SHUMAN
USE MODI_GRADIENT_M
USE MODI_BUDGET
USE MODI_LES_MEAN_SUBGRID
USE MODI_RMC01
USE MODI_GRADIENT_W
USE MODI_TM06
USE MODI_UPDATE_LM
!
USE MODE_SBL
USE MODE_FMWRIT
!
USE MODI_EMOIST
USE MODI_ETHETA
!
USE MODI_SECOND_MNH
!
IMPLICIT NONE
!
!
!* 0.1 declarations of arguments
!
!
!
INTEGER, INTENT(IN) :: KKA !near ground array index
INTEGER, INTENT(IN) :: KKU !uppest atmosphere array index
INTEGER, INTENT(IN) :: KKL !vert. levels type 1=MNH -1=ARO
INTEGER, INTENT(IN) :: KMI ! model index number
INTEGER, INTENT(IN) :: KRR ! number of moist var.
INTEGER, INTENT(IN) :: KRRL ! number of liquid water var.
INTEGER, INTENT(IN) :: KRRI ! number of ice water var.
CHARACTER(LEN=*),DIMENSION(:),INTENT(IN):: HLBCX, HLBCY ! X- and Y-direc LBC
INTEGER, INTENT(IN) :: KSPLIT ! number of time-splitting
INTEGER, INTENT(IN) :: KMODEL_CL ! model number for cloud mixing length
LOGICAL, INTENT(IN) :: OCLOSE_OUT ! switch for syncronous
! file opening
LOGICAL, INTENT(IN) :: OTURB_FLX ! switch to write the
! turbulent fluxes in the syncronous FM-file
LOGICAL, INTENT(IN) :: OTURB_DIAG ! switch to write some
! diagnostic fields in the syncronous FM-file
LOGICAL, INTENT(IN) :: OSUBG_COND ! switch for SUBGrid
! CONDensation
LOGICAL, INTENT(IN) :: ORMC01 ! switch for RMC01 lengths in SBL
CHARACTER*4 , INTENT(IN) :: HTURBDIM ! dimensionality of the
! turbulence scheme
CHARACTER*4 , INTENT(IN) :: HTURBLEN ! kind of mixing length
CHARACTER*4 , INTENT(IN) :: HTOM ! kind of Third Order Moment
CHARACTER*4 , INTENT(IN) :: HTURBLEN_CL ! kind of cloud mixing length
REAL, INTENT(IN) :: PIMPL ! degree of implicitness
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
CHARACTER(LEN=*), INTENT(IN) :: HFMFILE ! Name of the output
! FM-file
CHARACTER(LEN=*), INTENT(IN) :: HLUOUT ! Output-listing name for
! model n
!
REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX,PDYY,PDZZ,PDZX,PDZY
! metric coefficients
REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! physical distance
! between 2 succesive grid points along the K direction
REAL, DIMENSION(:,:), INTENT(IN) :: PDIRCOSXW, PDIRCOSYW, PDIRCOSZW
! Director Cosinus along x, y and z directions at surface w-point
REAL, DIMENSION(:,:), INTENT(IN) :: PCOSSLOPE ! cosinus of the angle
! between i and the slope vector
REAL, DIMENSION(:,:), INTENT(IN) :: PSINSLOPE ! sinus of the angle
! between i and the slope vector
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry density * Grid size
REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! Virtual Potential
! Temperature of the reference state
REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! dry density of the
! reference state
!
REAL, DIMENSION(:,:), INTENT(IN) :: PSFTH,PSFRV, &
! normal surface fluxes of theta and Rv
PSFU,PSFV
! normal surface fluxes of (u,v) parallel to the orography
REAL, DIMENSION(:,:,:), INTENT(IN) :: PSFSV
! normal surface fluxes of Scalar var.
!
! prognostic variables at t- deltat
REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! Pressure at time t
REAL, DIMENSION(:,:,:), INTENT(IN) :: PUT,PVT,PWT ! wind components
REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKET ! TKE
REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVT ! passive scal. var.
REAL, DIMENSION(:,:,:), INTENT(IN) :: PSRCT ! Second-order flux
! s'rc'/2Sigma_s2 at time t-1 multiplied by Lambda_3
REAL, DIMENSION(:,:), INTENT(INOUT) :: PBL_DEPTH ! BL height for TOMS
REAL, DIMENSION(:,:), INTENT(INOUT) :: PSBL_DEPTH ! SBL depth for RMC01
!
! variables for cloud mixing length
REAL, DIMENSION(:,:,:), INTENT(IN) :: PCEI ! Cloud Entrainment instability
! index to emphasize localy
! turbulent fluxes
REAL, INTENT(IN) :: PCEI_MIN ! minimum threshold for the instability index CEI
REAL, INTENT(IN) :: PCEI_MAX ! maximum threshold for the instability index CEI
REAL, INTENT(IN) :: PCOEF_AMPL_SAT ! saturation of the amplification coefficient
!
! thermodynamical variables which are transformed in conservative var.
REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTHLT ! conservative pot. temp.
REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRT ! water var. where
! PRT(:,:,:,1) is the conservative mixing ratio
!
! sources of momentum, conservative potential temperature, Turb. Kin. Energy,
! TKE dissipation
REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS,PRVS,PRWS,PRTHLS,PRTKES
! Source terms for all water kinds, PRRS(:,:,:,1) is used for the conservative
! mixing ratio
REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS
! Source terms for all passive scalar variables
REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS
! Sigma_s at time t+1 : square root of the variance of the deviation to the
! saturation
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSIGS
REAL, DIMENSION(:,:,:), INTENT(IN) :: PFLXZTHVMF
! MF contribution for vert. turb. transport
! used in the buoy. prod. of TKE
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWTH ! heat flux
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWRC ! cloud water flux
REAL, DIMENSION(:,:,:,:),INTENT(OUT) :: PWSV ! scalar flux
REAL, DIMENSION(:,:,:), INTENT(INOUT):: PDYP ! Dynamical production of TKE
REAL, DIMENSION(:,:,:), INTENT(INOUT):: PTHP ! Thermal production of TKE
REAL, DIMENSION(:,:,:), INTENT(OUT):: PTR ! Transport production of TKE
REAL, DIMENSION(:,:,:), INTENT(OUT):: PDISS ! Dissipation of TKE
REAL, DIMENSION(:,:,:), INTENT(INOUT):: PLEM ! Mixing length
!
!
!-------------------------------------------------------------------------------
!
! 0.2 declaration of local variables
!
REAL, ALLOCATABLE, DIMENSION(:,:,:) ::&
ZCP, & ! Cp at t-1
ZEXN, & ! EXN at t-1
ZT, & ! T at t-1
ZLOCPEXNM, & ! Lv/Cp/EXNREF at t-1
ZLM, & ! Turbulent mixing length
ZLEPS, & ! Dissipative length
ZDP,ZTP, ZTRH, & ! Dynamic and Thermal Production of TKE
ZATHETA,ZAMOIST, & ! coefficients for s = f (Thetal,Rnp)
ZCOEF_DISS, & ! 1/(Cph*Exner) for dissipative heating
ZFRAC_ICE, & ! ri fraction of rc+ri
ZMWTH,ZMWR,ZMTH2,ZMR2,ZMTHR,& ! 3rd order moments
ZFWTH,ZFWR,ZFTH2,ZFR2,ZFTHR,& ! opposite of verticale derivate of 3rd order moments
ZTHLM, ZTR, ZDISS ! initial potential temp.
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
REAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: &
ZRM ! initial mixing ratio
REAL, ALLOCATABLE, DIMENSION(:,:) :: ZTAU11M,ZTAU12M, &
ZTAU22M,ZTAU33M, &
! tangential surface fluxes in the axes following the orography
ZUSLOPE,ZVSLOPE, &
! wind components at the first mass level parallel
! to the orography
ZCDUEFF, &
! - Cd*||u|| where ||u|| is the module of the wind tangential to
! orography (ZUSLOPE,ZVSLOPE) at the surface.
ZUSTAR, ZLMO, &
ZRVM, ZSFRV
! friction velocity, Monin Obuhkov length, work arrays for vapor
!
! Virtual Potential Temp. used
! in the Deardorff mixing length computation
REAL, DIMENSION(:,:,:), ALLOCATABLE :: &
ZLVOCPEXNM,ZLSOCPEXNM, & ! Lv/Cp/EXNREF and Ls/Cp/EXNREF at t-1
ZATHETA_ICE,ZAMOIST_ICE ! coefficients for s = f (Thetal,Rnp)
!
REAL :: ZEXPL ! 1-PIMPL deg of expl.
REAL :: ZRVORD ! RV/RD
!
INTEGER :: IKB,IKE ! index value for the
! Beginning and the End of the physical domain for the mass points
INTEGER :: IKT ! array size in k direction
INTEGER :: IKTB,IKTE ! start, end of k loops in physical domain
INTEGER :: JRR,JK,JSV ! loop counters
INTEGER :: JI,JJ ! loop counters
INTEGER :: IRESP ! Return code of FM routines
INTEGER :: IGRID ! C-grid indicator in LFIFM file
INTEGER :: ILENCH ! Length of comment string in LFIFM file
CHARACTER (LEN=100) :: YCOMMENT ! comment string in LFIFM file
CHARACTER (LEN=16) :: YRECFM ! Name of the desired field in LFIFM file
REAL :: ZL0 ! Max. Mixing Length in Blakadar formula
REAL :: ZALPHA ! proportionnality constant between Dz/2 and
! ! BL89 mixing length near the surface
!
REAL :: ZTIME1, ZTIME2
!
!------------------------------------------------------------------------------------------
ALLOCATE ( &
ZCP(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZEXN(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZT(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZLOCPEXNM(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZLM(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZLEPS(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZDP(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZTP(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZTRH(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZATHETA(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZAMOIST(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZCOEF_DISS(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZFRAC_ICE(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZMWTH(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZMWR(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZMTH2(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZMR2(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZMTHR(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZFWTH(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZFWR(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZFTH2(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZFR2(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZFTHR(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)), &
ZTHLM(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)) )
ALLOCATE ( ZRM(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3),SIZE(PRT,4)) )
ZTAU11M(SIZE(PTHLT,1),SIZE(PTHLT,2)), &
ZTAU12M(SIZE(PTHLT,1),SIZE(PTHLT,2)), &
ZTAU22M(SIZE(PTHLT,1),SIZE(PTHLT,2)), &
ZTAU33M(SIZE(PTHLT,1),SIZE(PTHLT,2)), &
ZUSLOPE(SIZE(PTHLT,1),SIZE(PTHLT,2)), &
ZVSLOPE(SIZE(PTHLT,1),SIZE(PTHLT,2)), &
ZCDUEFF(SIZE(PTHLT,1),SIZE(PTHLT,2)), &
ZUSTAR(SIZE(PTHLT,1),SIZE(PTHLT,2)), &
ZLMO(SIZE(PTHLT,1),SIZE(PTHLT,2)), &
ZRVM(SIZE(PTHLT,1),SIZE(PTHLT,2)), &
ZSFRV(SIZE(PTHLT,1),SIZE(PTHLT,2)) )
!------------------------------------------------------------------------------------------
!
!* 1.PRELIMINARIES
! -------------
!
!* 1.1 Set the internal domains, ZEXPL
!
!
IKTB=1+JPVEXT_TURB
IKTE=IKT-JPVEXT_TURB
IKB=KKA+JPVEXT_TURB*KKL
IKE=KKU-JPVEXT_TURB*KKL
!
ZEXPL = 1.- PIMPL
ZRVORD= XRV / XRD
!
!
ZTHLM(:,:,:) = PTHLT(:,:,:)
ZRM(:,:,:,:) = PRT(:,:,:,:)
!
!
!
!----------------------------------------------------------------------------
!
!* 2. COMPUTE CONSERVATIVE VARIABLES AND RELATED QUANTITIES
! -----------------------------------------------------
!
!* 2.1 Cph at t
!
ZCP=XCPD
!
IF (KRR > 0) ZCP(:,:,:) = ZCP(:,:,:) + XCPV * PRT(:,:,:,1)
DO JRR = 2,1+KRRL ! loop on the liquid components
ZCP(:,:,:) = ZCP(:,:,:) + XCL * PRT(:,:,:,JRR)
END DO
!
DO JRR = 2+KRRL,1+KRRL+KRRI ! loop on the solid components
ZCP(:,:,:) = ZCP(:,:,:) + XCI * PRT(:,:,:,JRR)
END DO
!
!* 2.2 Exner function at t
!
ZEXN(:,:,:) = (PPABST(:,:,:)/XP00) ** (XRD/XCPD)
!
!* 2.3 dissipative heating coeff a t
!
ZCOEF_DISS(:,:,:) = 1/(ZCP(:,:,:) * ZEXN(:,:,:))
!
!
ZFRAC_ICE(:,:,:) = 0.0
ZATHETA(:,:,:) = 0.0
ZAMOIST(:,:,:) = 0.0
!
IF (KRRL >=1) THEN
!
!* 2.4 Temperature at t
!
!
!* 2.5 Lv/Cph/Exn
!
IF ( KRRI >= 1 ) THEN
ALLOCATE(ZLVOCPEXNM(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)))
ALLOCATE(ZLSOCPEXNM(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)))
ALLOCATE(ZAMOIST_ICE(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)))
ALLOCATE(ZATHETA_ICE(SIZE(PTHLT,1),SIZE(PTHLT,2),SIZE(PTHLT,3)))
!
CALL COMPUTE_FUNCTION_THERMO(XALPW,XBETAW,XGAMW,XLVTT,XCL,ZT,ZEXN,ZCP, &
ZLVOCPEXNM,ZAMOIST,ZATHETA)
CALL COMPUTE_FUNCTION_THERMO(XALPI,XBETAI,XGAMI,XLSTT,XCI,ZT,ZEXN,ZCP, &
ZLSOCPEXNM,ZAMOIST_ICE,ZATHETA_ICE)
!
WHERE(PRT(:,:,:,2)+PRT(:,:,:,4)>0.0)
ZFRAC_ICE(:,:,:) = PRT(:,:,:,4) / ( PRT(:,:,:,2)+PRT(:,:,:,4) )
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
END WHERE
!
ZLOCPEXNM(:,:,:) = (1.0-ZFRAC_ICE(:,:,:))*ZLVOCPEXNM(:,:,:) &
+ZFRAC_ICE(:,:,:) *ZLSOCPEXNM(:,:,:)
ZAMOIST(:,:,:) = (1.0-ZFRAC_ICE(:,:,:))*ZAMOIST(:,:,:) &
+ZFRAC_ICE(:,:,:) *ZAMOIST_ICE(:,:,:)
ZATHETA(:,:,:) = (1.0-ZFRAC_ICE(:,:,:))*ZATHETA(:,:,:) &
+ZFRAC_ICE(:,:,:) *ZATHETA_ICE(:,:,:)
DEALLOCATE(ZAMOIST_ICE)
DEALLOCATE(ZATHETA_ICE)
ELSE
CALL COMPUTE_FUNCTION_THERMO(XALPW,XBETAW,XGAMW,XLVTT,XCL,ZT,ZEXN,ZCP, &
ZLOCPEXNM,ZAMOIST,ZATHETA)
END IF
!
!
IF (OCLOSE_OUT .AND. OTURB_DIAG) THEN
YRECFM ='ATHETA'
YCOMMENT='X_Y_Z_ATHETA (M)'
IGRID = 1
ILENCH=LEN(YCOMMENT)
CALL FMWRIT(HFMFILE,YRECFM,HLUOUT,'XY',ZATHETA,IGRID,ILENCH,YCOMMENT,IRESP)
!
YRECFM ='AMOIST'
YCOMMENT='X_Y_Z_AMOIST (M)'
IGRID = 1
ILENCH=LEN(YCOMMENT)
CALL FMWRIT(HFMFILE,YRECFM,HLUOUT,'XY',ZAMOIST,IGRID,ILENCH,YCOMMENT,IRESP)
END IF
!
ELSE
ZLOCPEXNM=0.
END IF ! loop end on KRRL >= 1
!
! computes conservative variables
!
IF ( KRRL >= 1 ) THEN
IF ( KRRI >= 1 ) THEN
! Rnp at t
PRT(:,:,:,1) = PRT(:,:,:,1) + PRT(:,:,:,2) + PRT(:,:,:,4)
PRRS(:,:,:,1) = PRRS(:,:,:,1) + PRRS(:,:,:,2) + PRRS(:,:,:,4)
! Theta_l at t
PTHLT(:,:,:) = PTHLT(:,:,:) - ZLVOCPEXNM(:,:,:) * PRT(:,:,:,2) &
- ZLSOCPEXNM(:,:,:) * PRT(:,:,:,4)
PRTHLS(:,:,:) = PRTHLS(:,:,:) - ZLVOCPEXNM(:,:,:) * PRRS(:,:,:,2) &
- ZLSOCPEXNM(:,:,:) * PRRS(:,:,:,4)
ELSE
! Rnp at t
PRT(:,:,:,1) = PRT(:,:,:,1) + PRT(:,:,:,2)
PRRS(:,:,:,1) = PRRS(:,:,:,1) + PRRS(:,:,:,2)
! Theta_l at t
PTHLT(:,:,:) = PTHLT(:,:,:) - ZLOCPEXNM(:,:,:) * PRT(:,:,:,2)
PRTHLS(:,:,:) = PRTHLS(:,:,:) - ZLOCPEXNM(:,:,:) * PRRS(:,:,:,2)
END IF
END IF
!
!----------------------------------------------------------------------------
!
!* 3. MIXING LENGTH : SELECTION AND COMPUTATION
! -----------------------------------------
!
!
SELECT CASE (HTURBLEN)
!
!* 3.1 BL89 mixing length
! ------------------
CASE ('BL89')
CALL BL89(KKA,KKU,KKL,PZZ,PDZZ,PTHVREF,ZTHLM,KRR,ZRM,PTKET,ZLM)
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
!
!* 3.2 Delta mixing length
! -------------------
!
CASE ('DELT')
CALL DELT(ZLM)
!
!* 3.3 Deardorff mixing length
! -----------------------
!
CASE ('DEAR')
CALL DEAR(ZLM)
!
!* 3.4 Blackadar mixing length
! -----------------------
!
CASE ('BLKR')
ZL0 = 100.
ZLM(:,:,:) = ZL0
ZALPHA=0.5**(-1.5)
!
DO JK=IKTB,IKTE
ZLM(:,:,JK) = ( 0.5*(PZZ(:,:,JK)+PZZ(:,:,JK+KKL)) - &
& PZZ(:,:,KKA+JPVEXT_TURB*KKL) ) * PDIRCOSZW(:,:)
ZLM(:,:,JK) = ZALPHA * ZLM(:,:,JK) * ZL0 / ( ZL0 + ZALPHA*ZLM(:,:,JK) )
END DO
!
ZLM(:,:,IKTB-1) = ZLM(:,:,IKTB)
ZLM(:,:,IKTE+1) = ZLM(:,:,IKTE)
!
!
!
END SELECT
!
!
!
!* 3.5 Mixing length modification for cloud
! -----------------------
IF (KMODEL_CL==KMI .AND. HTURBLEN_CL/='NONE') CALL CLOUD_MODIF_LM
!
!* 3.6 Dissipative length
! ------------------
!
ZLEPS=ZLM
!
!* 3.7 Correction in the Surface Boundary Layer (Redelsperger 2001)
! ----------------------------------------
!
ZLMO=XUNDEF
IF (ORMC01) THEN
ZUSTAR=(PSFU**2+PSFV**2)**(0.25)
IF (KRR>0) THEN
ZLMO=LMO(ZUSTAR,ZTHLM(:,:,IKB),ZRM(:,:,IKB,1),PSFTH,PSFRV)
ELSE
ZRVM=0.
ZSFRV=0.
ZLMO=LMO(ZUSTAR,ZTHLM(:,:,IKB),ZRVM,PSFTH,ZSFRV)
END IF
CALL RMC01(HTURBLEN,KKA,KKU,KKL,PZZ,PDXX,PDYY,PDZZ,PDIRCOSZW,PSBL_DEPTH,ZLMO,ZLM,ZLEPS)
END IF
!
!* 3.8 Mixing length in external points (used if HTURBDIM="3DIM")
! ----------------------------------------------------------
!
IF (HTURBDIM=="3DIM") THEN
CALL UPDATE_LM(HLBCX,HLBCY,ZLM,ZLEPS)
END IF
!----------------------------------------------------------------------------
!
!* 4. GO INTO THE AXES FOLLOWING THE SURFACE
! --------------------------------------
!
!
!* 4.1 rotate the wind at time t
!
!
!
IF (CPROGRAM=='AROME ') THEN
ELSE
CALL ROTATE_WIND(PUT,PVT,PWT, &
PDIRCOSXW, PDIRCOSYW, PDIRCOSZW, &
PCOSSLOPE,PSINSLOPE, &
PDXX,PDYY,PDZZ, &
ZUSLOPE,ZVSLOPE )
CALL UPDATE_ROTATE_WIND(ZUSLOPE,ZVSLOPE)
END IF
!
!
!* 4.2 compute the proportionality coefficient between wind and stress
!
ZCDUEFF(:,:) =-SQRT ( (PSFU(:,:)**2 + PSFV(:,:)**2) / &
(XMNH_TINY + ZUSLOPE(:,:)**2 + ZVSLOPE(:,:)**2 ) &
)
!
!* 4.6 compute the surface tangential fluxes
!
ZTAU11M(:,:) =2./3.*( (1.+ (PZZ (:,:,IKB+KKL)-PZZ (:,:,IKB)) &
/(PDZZ(:,:,IKB+KKL)+PDZZ(:,:,IKB)) &
) *PTKET(:,:,IKB) &
-0.5 *PTKET(:,:,IKB+KKL) &
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
)
ZTAU12M(:,:) =0.0
ZTAU22M(:,:) =ZTAU11M(:,:)
ZTAU33M(:,:) =ZTAU11M(:,:)
!
!* 4.7 third order terms in temperature and water fluxes and correlations
! ------------------------------------------------------------------
!
!
ZMWTH = 0. ! w'2th'
ZMWR = 0. ! w'2r'
ZMTH2 = 0. ! w'th'2
ZMR2 = 0. ! w'r'2
ZMTHR = 0. ! w'th'r'
IF (HTOM=='TM06') CALL TM06(KKA,KKU,KKL,PTHVREF,PBL_DEPTH,PZZ,PSFTH,ZMWTH,ZMTH2)
!
ZFWTH = -GZ_M_W(KKA,KKU,KKL,ZMWTH,PDZZ) ! -d(w'2th' )/dz
ZFWR = -GZ_M_W(KKA,KKU,KKL,ZMWR, PDZZ) ! -d(w'2r' )/dz
ZFTH2 = -GZ_W_M(KKA,KKU,KKL,ZMTH2,PDZZ) ! -d(w'th'2 )/dz
ZFR2 = -GZ_W_M(KKA,KKU,KKL,ZMR2, PDZZ) ! -d(w'r'2 )/dz
ZFTHR = -GZ_W_M(KKA,KKU,KKL,ZMTHR,PDZZ) ! -d(w'th'r')/dz
!
ZFWTH(:,:,IKTE:) = 0.
ZFWTH(:,:,:IKTB) = 0.
ZFWR (:,:,IKTE:) = 0.
ZFWR (:,:,:IKTB) = 0.
ZFTH2(:,:,IKTE:) = 0.
ZFTH2(:,:,:IKTB) = 0.
ZFR2 (:,:,IKTE:) = 0.
ZFR2 (:,:,:IKTB) = 0.
ZFTHR(:,:,IKTE:) = 0.
ZFTHR(:,:,:IKTB) = 0.
!
!----------------------------------------------------------------------------
!
!* 5. TURBULENT SOURCES
! -----------------
!
CALL TURB_VER(KKA,KKU,KKL,KRR, KRRL, KRRI, &
OCLOSE_OUT,OTURB_FLX, &
HTURBDIM,HTOM,PIMPL,ZEXPL, &
PDXX,PDYY,PDZZ,PDZX,PDZY,PDIRCOSZW,PZZ, &
PCOSSLOPE,PSINSLOPE, &
PRHODJ,PTHVREF, &
PSFTH,PSFRV,PSFSV,PSFTH,PSFRV,PSFSV, &
ZCDUEFF,ZTAU11M,ZTAU12M,ZTAU33M, &
PUT,PVT,PWT,ZUSLOPE,ZVSLOPE,PTHLT,PRT,PSVT, &
PTKET,ZLM,ZLEPS, &
ZLOCPEXNM,ZATHETA,ZAMOIST,PSRCT,ZFRAC_ICE, &
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
ZFWTH,ZFWR,ZFTH2,ZFR2,ZFTHR,PBL_DEPTH, &
PSBL_DEPTH,ZLMO, &
PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS, &
ZDP,ZTP,PSIGS,PWTH,PWRC,PWSV )
!
IF (LBUDGET_U) CALL BUDGET (PRUS,1,'VTURB_BU_RU')
IF (LBUDGET_V) CALL BUDGET (PRVS,2,'VTURB_BU_RV')
IF (LBUDGET_W) CALL BUDGET (PRWS,3,'VTURB_BU_RW')
IF (LBUDGET_TH) THEN
IF ( KRRI >= 1 .AND. KRRL >= 1 ) THEN
CALL BUDGET (PRTHLS+ ZLVOCPEXNM * PRRS(:,:,:,2) + ZLSOCPEXNM * PRRS(:,:,:,4),4,'VTURB_BU_RTH')
ELSE IF ( KRRL >= 1 ) THEN
CALL BUDGET (PRTHLS+ ZLOCPEXNM * PRRS(:,:,:,2),4,'VTURB_BU_RTH')
ELSE
CALL BUDGET (PRTHLS,4,'VTURB_BU_RTH')
END IF
END IF
IF (LBUDGET_SV) THEN
DO JSV = 1,NSV
CALL BUDGET (PRSVS(:,:,:,JSV),JSV+12,'VTURB_BU_RSV')
END DO
END IF
IF (LBUDGET_RV) THEN
IF ( KRRI >= 1 .AND. KRRL >= 1) THEN
CALL BUDGET (PRRS(:,:,:,1)-PRRS(:,:,:,2)-PRRS(:,:,:,4),6,'VTURB_BU_RRV')
ELSE IF ( KRRL >= 1 ) THEN
CALL BUDGET (PRRS(:,:,:,1)-PRRS(:,:,:,2),6,'VTURB_BU_RRV')
ELSE
CALL BUDGET (PRRS(:,:,:,1),6,'VTURB_BU_RRV')
END IF
END IF
IF (LBUDGET_RC) CALL BUDGET (PRRS(:,:,:,2),7,'VTURB_BU_RRC')
IF (LBUDGET_RI) CALL BUDGET (PRRS(:,:,:,4),9,'VTURB_BU_RRI')
!
!
IF (HTURBDIM=='3DIM') THEN
CALL TURB_HOR_SPLT(KSPLIT, KRR, KRRL, KRRI, PTSTEP, &
HLBCX,HLBCY,OCLOSE_OUT,OTURB_FLX,OSUBG_COND, &
HFMFILE,HLUOUT, &
PDXX,PDYY,PDZZ,PDZX,PDZY,PZZ, &
PDIRCOSXW,PDIRCOSYW,PDIRCOSZW, &
PCOSSLOPE,PSINSLOPE, &
PRHODJ,PTHVREF, &
PSFTH,PSFRV,PSFSV, &
ZCDUEFF,ZTAU11M,ZTAU12M,ZTAU22M,ZTAU33M, &
PUT,PVT,PWT,ZUSLOPE,ZVSLOPE,PTHLT,PRT,PSVT, &
PTKET,ZLM,ZLEPS, &
ZLOCPEXNM,ZATHETA,ZAMOIST,PSRCT,ZFRAC_ICE, &
ZDP,ZTP,PSIGS, &
ZTRH, &
PRUS,PRVS,PRWS,PRTHLS,PRRS,PRSVS )
END IF
!
!
IF (LBUDGET_U) CALL BUDGET (PRUS,1,'HTURB_BU_RU')
IF (LBUDGET_V) CALL BUDGET (PRVS,2,'HTURB_BU_RV')
IF (LBUDGET_W) CALL BUDGET (PRWS,3,'HTURB_BU_RW')
IF (LBUDGET_TH) THEN
IF ( KRRI >= 1 .AND. KRRL >= 1 ) THEN
CALL BUDGET (PRTHLS+ZLVOCPEXNM*PRRS(:,:,:,2)+ZLSOCPEXNM*PRRS(:,:,:,4) &
,4,'HTURB_BU_RTH')
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
ELSE IF ( KRRL >= 1 ) THEN
CALL BUDGET (PRTHLS+ ZLOCPEXNM * PRRS(:,:,:,2),4,'HTURB_BU_RTH')
ELSE
CALL BUDGET (PRTHLS,4,'HTURB_BU_RTH')
END IF
END IF
IF (LBUDGET_SV) THEN
DO JSV = 1,NSV
CALL BUDGET (PRSVS(:,:,:,JSV),JSV+12,'HTURB_BU_RSV')
END DO
END IF
IF (LBUDGET_RV) THEN
IF ( KRRI >= 1 .AND. KRRL >= 1) THEN
CALL BUDGET (PRRS(:,:,:,1)-PRRS(:,:,:,2)-PRRS(:,:,:,4),6,'HTURB_BU_RRV')
ELSE IF ( KRRL >= 1 ) THEN
CALL BUDGET (PRRS(:,:,:,1)-PRRS(:,:,:,2),6,'HTURB_BU_RRV')
ELSE
CALL BUDGET (PRRS(:,:,:,1),6,'HTURB_BU_RRV')
END IF
END IF
IF (LBUDGET_RC) CALL BUDGET (PRRS(:,:,:,2),7,'HTURB_BU_RRC')
IF (LBUDGET_RI) CALL BUDGET (PRRS(:,:,:,4),9,'HTURB_BU_RRI')
!
!----------------------------------------------------------------------------
!
!* 6. EVOLUTION OF THE TKE AND ITS DISSIPATION
! ----------------------------------------
!
! 6.1 Contribution of mass-flux in the TKE buoyancy production if
! cloud computation is not statistical
ZTP = ZTP + XG / PTHVREF * MZF(KKA,KKU,KKL, PFLXZTHVMF )
! 6.2 TKE evolution equation
CALL TKE_EPS_SOURCES(KKA,KKU,KKL,KMI,PTKET,ZLM,ZLEPS,ZDP,ZTRH, &
PRHODJ,PDZZ,PDXX,PDYY,PDZX,PDZY,PZZ, &
HTURBLEN,HTURBDIM, &
HFMFILE,HLUOUT,OCLOSE_OUT,OTURB_DIAG, &
ZTP,PRTKES,PRTKEMS,PRTHLS,ZCOEF_DISS,PTR,PDISS )
!
PDYP = ZDP
PTHP = ZTP
!
IF (LBUDGET_TH) THEN
IF ( KRRI >= 1 .AND. KRRL >= 1 ) THEN
CALL BUDGET (PRTHLS+ZLVOCPEXNM*PRRS(:,:,:,2)+ZLSOCPEXNM*PRRS(:,:,:,4) &
,4,'DISSH_BU_RTH')
CALL BUDGET (PRTHLS+ZLOCPEXNM* PRRS(:,:,:,2),4,'DISSH_BU_RTH')