Newer
Older
CALL SECOND_MNH2(ZTIME2)
!
XT_STORE = XT_STORE + ZTIME2 - ZTIME1
!
!-------------------------------------------------------------------------------
!
!* 5. INITIALIZATION OF THE BUDGET VARIABLES
! --------------------------------------
!
IF (NBUMOD==IMI) THEN
LBU_ENABLE = CBUTYPE /='NONE'.AND. CBUTYPE /='SKIP'
ELSE
LBU_ENABLE = .FALSE.
END IF
!
IF (NBUMOD==IMI .AND. CBUTYPE=='MASK' ) THEN
CALL SET_MASK
IF (LBU_RU) XBURHODJU(:,NBUTIME,:) = XBURHODJU(:,NBUTIME,:) &
+ MASK_COMPRESS(MXM(XRHODJ))
IF (LBU_RV) XBURHODJV(:,NBUTIME,:) = XBURHODJV(:,NBUTIME,:) &
+ MASK_COMPRESS(MYM(XRHODJ))
IF (LBU_RW) XBURHODJW(:,NBUTIME,:) = XBURHODJW(:,NBUTIME,:) &
+ MASK_COMPRESS(MZM(1,IKU,1,XRHODJ))
IF (ALLOCATED(XBURHODJ)) &
XBURHODJ (:,NBUTIME,:) = XBURHODJ (:,NBUTIME,:) &
+ MASK_COMPRESS(XRHODJ)
IF (NBUMOD==IMI .AND. CBUTYPE=='CART' ) THEN
IF (LBU_RU) XBURHODJU(:,:,:) = XBURHODJU(:,:,:) &
+ CART_COMPRESS(MXM(XRHODJ))
IF (LBU_RV) XBURHODJV(:,:,:) = XBURHODJV(:,:,:) &
+ CART_COMPRESS(MYM(XRHODJ))
IF (LBU_RW) XBURHODJW(:,:,:) = XBURHODJW(:,:,:) &
+ CART_COMPRESS(MZM(1,IKU,1,XRHODJ))
IF (ALLOCATED(XBURHODJ)) &
XBURHODJ (:,:,:) = XBURHODJ (:,:,:) &
+ CART_COMPRESS(XRHODJ)
END IF
!
CALL BUDGET_FLAGS(LUSERV, LUSERC, LUSERR, &
LUSERI, LUSERS, LUSERG, LUSERH )
!
XTIME_BU = 0.0
!
!-------------------------------------------------------------------------------
!
!* 6. INITIALIZATION OF THE FIELD TENDENCIES
! --------------------------------------
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
!
CALL INITIAL_GUESS ( NRR, NSV, KTCOUNT, XRHODJ,IMI, XTSTEP, &
XRUS, XRVS, XRWS, XRTHS, XRRS, XRTKES, XRSVS, &
!
CALL SECOND_MNH2(ZTIME2)
!
XT_GUESS = XT_GUESS + ZTIME2 - ZTIME1 - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
!
!* 7. INITIALIZATION OF THE LES FOR CURRENT TIME-STEP
! -----------------------------------------------
!
XTIME_LES_BU = 0.0
XTIME_LES = 0.0
!
!-------------------------------------------------------------------------------
!
!* 8. TWO-WAY INTERACTIVE GRID-NESTING
! --------------------------------
!
!
CALL SECOND_MNH2(ZTIME1)
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
GMASKkids(:,:)=.FALSE.
!
IF (NMODEL>1) THEN
! correct an ifort bug
DPTR_XRHODJ=>XRHODJ
DPTR_XUM=>XUT
DPTR_XVM=>XVT
DPTR_XWM=>XWT
DPTR_XTHM=>XTHT
DPTR_XRM=>XRT
DPTR_XTKEM=>XTKET
DPTR_XSVM=>XSVT
DPTR_XRUS=>XRUS
DPTR_XRVS=>XRVS
DPTR_XRWS=>XRWS
DPTR_XRTHS=>XRTHS
DPTR_XRRS=>XRRS
DPTR_XRTKES=>XRTKES
DPTR_XRSVS=>XRSVS
DPTR_XINPRC=>XINPRC
DPTR_XINPRR=>XINPRR
DPTR_XINPRS=>XINPRS
DPTR_XINPRG=>XINPRG
DPTR_XINPRH=>XINPRH
DPTR_XPRCONV=>XPRCONV
DPTR_XPRSCONV=>XPRSCONV
DPTR_XDIRFLASWD=>XDIRFLASWD
DPTR_XSCAFLASWD=>XSCAFLASWD
DPTR_XDIRSRFSWD=>XDIRSRFSWD
DPTR_GMASKkids=>GMASKkids
!
CALL TWO_WAY( NRR,NSV,KTCOUNT,DPTR_XRHODJ,IMI,XTSTEP, &
DPTR_XUM ,DPTR_XVM ,DPTR_XWM , DPTR_XTHM, DPTR_XRM, DPTR_XTKEM, DPTR_XSVM, &
DPTR_XRUS,DPTR_XRVS,DPTR_XRWS,DPTR_XRTHS,DPTR_XRRS,DPTR_XRTKES,DPTR_XRSVS, &
DPTR_XINPRC,DPTR_XINPRR,DPTR_XINPRS,DPTR_XINPRG,DPTR_XINPRH,DPTR_XPRCONV,DPTR_XPRSCONV, &
DPTR_XDIRFLASWD,DPTR_XSCAFLASWD,DPTR_XDIRSRFSWD,DPTR_GMASKkids )
END IF
!
CALL SECOND_MNH2(ZTIME2)
XT_2WAY = XT_2WAY + ZTIME2 - ZTIME1 - XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
!
!* 10. FORCING
! -------
!
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
CALL SM_GRIDCART(XXHAT,XYHAT,XZHAT,XZS,LSLEVE,XLEN1,XLEN2,XZSMT,XDXHAT,XDYHAT,XZZ,ZJ)
CALL SM_GRIDPROJ(XXHAT,XYHAT,XZHAT,XZS,LSLEVE,XLEN1,XLEN2,XZSMT,XLATORI,XLONORI, &
XMAP,XLAT,XLON,XDXHAT,XDYHAT,XZZ,ZJ)
END IF
CALL FORCING(XTSTEP,LUSERV,XRHODJ,XCORIOZ,XZHAT,XZZ,TDTCUR,&
XUFRC_PAST, XVFRC_PAST, &
XUT,XVT,XWT,XTHT,XTKET,XRT,XSVT, &
XRUS,XRVS,XRWS,XRTHS,XRTKES,XRRS,XRSVS,IMI,ZJ)
END IF
!
IF ( L2D_ADV_FRC ) THEN
CALL ADV_FORCING_n(XRHODJ,TDTCUR,XTHT,XRT,XZZ,XRTHS,XRRS)
END IF
IF ( L2D_REL_FRC ) THEN
CALL REL_FORCING_n(XRHODJ,TDTCUR,XTHT,XRT,XZZ,XRTHS,XRRS)
END IF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_FORCING = XT_FORCING + ZTIME2 - ZTIME1 &
- XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
!
!* 11. NUDGING
! -------
!
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
IF ( LNUDGING ) THEN
CALL NUDGING(LUSERV,XRHODJ,XTNUDGING, &
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
XLSUM,XLSVM,XLSWM,XLSTHM,XLSRVM, &
XRUS,XRVS,XRWS,XRTHS,XRRS)
END IF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_NUDGING = XT_NUDGING + ZTIME2 - ZTIME1 &
- XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
!
!* 12. DYNAMICAL SOURCES
! -----------------
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
IF( LTRANS ) THEN
XUT(:,:,:) = XUT(:,:,:) + XUTRANS
XVT(:,:,:) = XVT(:,:,:) + XVTRANS
END IF
!
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
XUT, XVT, XWT, XTHT, XRT, &
XCORIOX, XCORIOY, XCORIOZ, XCURVX, XCURVY, &
XRHODJ, XZZ, XTHVREF, XEXNREF, &
XRUS, XRVS, XRWS, XRTHS )
!
IF( LTRANS ) THEN
XUT(:,:,:) = XUT(:,:,:) - XUTRANS
XVT(:,:,:) = XVT(:,:,:) - XVTRANS
END IF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_SOURCES = XT_SOURCES + ZTIME2 - ZTIME1 &
- XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
!
!* 13. NUMERICAL DIFFUSION
! -------------------
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
IF ( LNUMDIFU .OR. LNUMDIFTH .OR. LNUMDIFSV ) THEN
!
CALL UPDATE_HALO_ll(TZFIELDT_ll, IINFO_ll)
CALL UPDATE_HALO2_ll(TZFIELDT_ll, TZHALO2T_ll, IINFO_ll)
IF ( .NOT. LSTEADYLS ) THEN
CALL UPDATE_HALO_ll(TZLSFIELD_ll, IINFO_ll)
CALL UPDATE_HALO2_ll(TZLSFIELD_ll, TZLSHALO2_ll, IINFO_ll)
END IF
CALL NUM_DIFF ( CLBCX, CLBCY, NRR, NSV, &
XDK2U, XDK4U, XDK2TH, XDK4TH, XDK2SV, XDK4SV, IMI, &
XLSUM,XLSVM,XLSWM,XLSTHM,XLSRVM,XRHODJ, &
XRUS, XRVS, XRWS, XRTHS, XRTKES, XRRS, XRSVS, &
LZDIFFU,LNUMDIFU, LNUMDIFTH, LNUMDIFSV, &
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
END IF
!
DO JSV = NSV_CHEMBEG,NSV_CHEMEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
DO JSV = NSV_CHICBEG,NSV_CHICEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
DO JSV = NSV_AERBEG,NSV_AEREND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
DO JSV = NSV_LNOXBEG,NSV_LNOXEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
DO JSV = NSV_DSTBEG,NSV_DSTEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
DO JSV = NSV_SLTBEG,NSV_SLTEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
DO JSV = NSV_PPBEG,NSV_PPEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
#ifdef MNH_FOREFIRE
DO JSV = NSV_FFBEG,NSV_FFEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
#endif
DO JSV = NSV_CSBEG,NSV_CSEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
DO JSV = NSV_DSTDEPBEG,NSV_DSTDEPEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
DO JSV = NSV_SLTDEPBEG,NSV_SLTDEPEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
DO JSV = NSV_AERDEPBEG,NSV_AERDEPEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
DO JSV = NSV_SNWBEG,NSV_SNWEND
XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.)
END DO
IF (CELEC .NE. 'NONE') THEN
XRSVS(:,:,:,NSV_ELECBEG) = MAX(XRSVS(:,:,:,NSV_ELECBEG),0.)
XRSVS(:,:,:,NSV_ELECEND) = MAX(XRSVS(:,:,:,NSV_ELECEND),0.)
END IF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_DIFF = XT_DIFF + ZTIME2 - ZTIME1 &
- XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
!
!* 14. UPPER AND LATERAL RELAXATION
! ----------------------------
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
IF(LVE_RELAX .OR. LVE_RELAX_GRD .OR. LHORELAX_UVWTH .OR. LHORELAX_RV .OR.&
LHORELAX_RC .OR. LHORELAX_RR .OR. LHORELAX_RI .OR. LHORELAX_RS .OR. &
LHORELAX_RG .OR. LHORELAX_RH .OR. LHORELAX_TKE .OR. &
ANY(LHORELAX_SV)) THEN
CALL RELAXATION (LVE_RELAX,LVE_RELAX_GRD,LHORELAX_UVWTH,LHORELAX_RV,LHORELAX_RC, &
LHORELAX_RR,LHORELAX_RI,LHORELAX_RS,LHORELAX_RG, &
LHORELAX_RH,LHORELAX_TKE,LHORELAX_SV, &
LHORELAX_SVC2R2,LHORELAX_SVC1R3, &
LHORELAX_SVELEC,LHORELAX_SVLG, &
LHORELAX_SVCHEM,LHORELAX_SVCHIC,LHORELAX_SVAER, &
LHORELAX_SVDST,LHORELAX_SVSLT,LHORELAX_SVPP, &
LHORELAX_SVCS,LHORELAX_SVSNW, &
#ifdef MNH_FOREFIRE
LHORELAX_SVFF, &
#endif
KTCOUNT,NRR,NSV,XTSTEP,XRHODJ, &
XLSUM, XLSVM, XLSWM, XLSTHM, &
XLBXUM, XLBXVM, XLBXWM, XLBXTHM, &
XLBXRM, XLBXSVM, XLBXTKEM, &
XLBYUM, XLBYVM, XLBYWM, XLBYTHM, &
XLBYRM, XLBYSVM, XLBYTKEM, &
NALBOT, XALK, XALKW, &
NALBAS, XALKBAS, XALKWBAS, &
LMASK_RELAX,XKURELAX, XKVRELAX, XKWRELAX, &
NRIMX,NRIMY, &
XRUS, XRVS, XRWS, XRTHS, XRRS, XRSVS, XRTKES )
END IF
IF (CELEC.NE.'NONE' .AND. LRELAX2FW_ION) THEN
CALL RELAX2FW_ION (KTCOUNT, IMI, XTSTEP, XRHODJ, XSVT, NALBOT, &
XALK, LMASK_RELAX, XKWRELAX, XRSVS )
END IF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_RELAX = XT_RELAX + ZTIME2 - ZTIME1 &
- XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
!
!* 15. PARAMETRIZATIONS' MONITOR
! -------------------------
!
ZTIME1 = ZTIME2
!

WAUTELET Philippe
committed
CALL PHYS_PARAM_n(KTCOUNT,TZBAKFILE, GCLOSE_OUT, &
XT_RAD,XT_SHADOWS,XT_DCONV,XT_GROUND,XT_MAFL, &
XT_DRAG,XT_TURB,XT_TRACER, &
ZTIME,ZWETDEPAER,GMASKkids,GCLOUD_ONLY)
!
IF (CDCONV/='NONE') THEN
XPACCONV = XPACCONV + XPRCONV * XTSTEP
IF (LCH_CONV_LINOX) THEN
XIC_TOTAL_NUMBER = XIC_TOTAL_NUMBER + XIC_RATE * XTSTEP
XCG_TOTAL_NUMBER = XCG_TOTAL_NUMBER + XCG_RATE * XTSTEP
END IF
END IF
!
IF (IBAK>0 .AND. IBAK <= NBAK_NUMB ) THEN
IF (KTCOUNT == TBACKUPN(IBAK)%NSTEP) THEN

WAUTELET Philippe
committed
TFILE_SURFEX => TZBAKFILE
CALL WRITE_DIAG_SURF_ATM_n(YSURF_CUR,'MESONH','ALL')

WAUTELET Philippe
committed
NULLIFY(TFILE_SURFEX)
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
!
CALL SECOND_MNH2(ZTIME2)
!
XT_PARAM = XT_PARAM + ZTIME2 - ZTIME1 - XTIME_LES - ZTIME
!
!-------------------------------------------------------------------------------
!
!* 16. TEMPORAL SERIES
! ---------------
!
ZTIME1 = ZTIME2
!
IF (LSERIES) THEN
IF ( MOD (KTCOUNT-1,NFREQSERIES) == 0 ) CALL SERIES_n
END IF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_STEP_MISC = XT_STEP_MISC + ZTIME2 - ZTIME1
!
!-------------------------------------------------------------------------------
!
!* 17. LARGE SCALE FIELD REFRESH
! -------------------------
!
ZTIME1 = ZTIME2
!
IF (.NOT. LSTEADYLS) THEN
IF ( IMI==1 .AND. &
NCPL_CUR < NCPL_NBR ) THEN
IF (KTCOUNT+1 == NCPL_TIMES(NCPL_CUR,1) ) THEN
! The next current time reachs a
NCPL_CUR=NCPL_CUR+1 ! coupling one, LS sources are refreshed
!
CALL LS_COUPLING(XTSTEP,GSTEADY_DMASS,CCONF, &
CGETTKET, &
CGETRVT,CGETRCT,CGETRRT,CGETRIT, &
CGETRST,CGETRGT,CGETRHT,CGETSVT,LCH_INIT_FIELD, NSV, &
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
NIMAX_ll,NJMAX_ll, &
NSIZELBX_ll,NSIZELBXU_ll,NSIZELBY_ll,NSIZELBYV_ll, &
NSIZELBXTKE_ll,NSIZELBYTKE_ll, &
NSIZELBXR_ll,NSIZELBYR_ll,NSIZELBXSV_ll,NSIZELBYSV_ll, &
XLSUM,XLSVM,XLSWM,XLSTHM,XLSRVM,XDRYMASST, &
XLBXUM,XLBXVM,XLBXWM,XLBXTHM,XLBXTKEM,XLBXRM,XLBXSVM, &
XLBYUM,XLBYVM,XLBYWM,XLBYTHM,XLBYTKEM,XLBYRM,XLBYSVM, &
XLSUS,XLSVS,XLSWS,XLSTHS,XLSRVS,XDRYMASSS, &
XLBXUS,XLBXVS,XLBXWS,XLBXTHS,XLBXTKES,XLBXRS,XLBXSVS, &
XLBYUS,XLBYVS,XLBYWS,XLBYTHS,XLBYTKES,XLBYRS,XLBYSVS )
!
DO JSV=NSV_CHEMBEG,NSV_CHEMEND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
DO JSV=NSV_LNOXBEG,NSV_LNOXEND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
DO JSV=NSV_AERBEG,NSV_AEREND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
DO JSV=NSV_DSTBEG,NSV_DSTEND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
DO JSV=NSV_DSTDEPBEG,NSV_DSTDEPEND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
DO JSV=NSV_SLTBEG,NSV_SLTEND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
DO JSV=NSV_SLTDEPBEG,NSV_SLTDEPEND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
DO JSV=NSV_PPBEG,NSV_PPEND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
#ifdef MNH_FOREFIRE
DO JSV=NSV_FFBEG,NSV_FFEND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
#endif
DO JSV=NSV_CSBEG,NSV_CSEND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
DO JSV=NSV_SNWBEG,NSV_SNWEND
XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.)
XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.)
ENDDO
!
END IF
END IF
END IF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_COUPL = XT_COUPL + ZTIME2 - ZTIME1
!
!-------------------------------------------------------------------------------
!
!
!* 8 Bis . Blowing snow scheme
! ---------
!
IF(LBLOWSNOW) THEN
CALL BLOWSNOW(CLBCX,CLBCY,XTSTEP,NRR,XPABST,XTHT,XRT,XZZ,XRHODREF, &
XRHODJ,XEXNREF,XRRS,XRTHS,XSVT,XRSVS,XSNWSUBL3D )
ENDIF
!

Gaelle DELAUTIER
committed
!-----------------------------------------------------------------------
!
!* 8 Ter VISCOSITY (no-slip condition inside)
! ---------
!
!
IF ( LVISC ) THEN
!
ZTIME1 = ZTIME2
CALL VISCOSITY(CLBCX, CLBCY, NRR, NSV, XMU_V,XPRANDTL, &

Gaelle DELAUTIER
committed
LVISC_UVW,LVISC_TH,LVISC_SV,LVISC_R, &
LDRAG, &
XUT, XVT, XWT, XTHT, XRT, XSVT, &
XRHODJ, XDXX, XDYY, XDZZ, XDZX, XDZY, &
XRUS, XRVS, XRWS, XRTHS, XRRS, XRSVS,XDRAG )
!
ENDIF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_VISC = XT_VISC + ZTIME2 - ZTIME1
!!
!-------------------------------------------------------------------------------
!
!* 9. ADVECTION
! ---------
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
!
!
CALL MPPDB_CHECK3DM("before ADVEC_METSV:XU/V/W/TH/TKE/T,XRHODJ",PRECISION,&
& XUT, XVT, XWT, XTHT, XTKET,XRHODJ)
CALL ADVECTION_METSV ( TZBAKFILE, GCLOSE_OUT,CUVW_ADV_SCHEME, &

WAUTELET Philippe
committed
CMET_ADV_SCHEME, CSV_ADV_SCHEME, CCLOUD, NSPLIT, &
LSPLIT_CFL, XSPLIT_CFL, LCFL_WRIT, &
CLBCX, CLBCY, NRR, NSV, TDTCUR, XTSTEP, &
XUT, XVT, XWT, XTHT, XRT, XTKET, XSVT, XPABST, &
XTHVREF, XRHODJ, XDXX, XDYY, XDZZ, XDZX, XDZY, &
XRTHS, XRRS, XRTKES, XRSVS, &
XRTHS_CLD, XRRS_CLD, XRSVS_CLD, XRTKEMS )
CALL MPPDB_CHECK3DM("after ADVEC_METSV:XU/V/W/TH/TKE/T,XRHODJ ",PRECISION,&
& XUT, XVT, XWT, XTHT, XTKET,XRHODJ)
!
CALL SECOND_MNH2(ZTIME2)
!
XT_ADV = XT_ADV + ZTIME2 - ZTIME1 - XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
ZRWS = XRWS
!
CALL GRAVITY_IMPL ( CLBCX, CLBCY, NRR, NRRL, NRRI,XTSTEP, &
XTHT, XRT, XTHVREF, XRHODJ, XRWS, XRTHS, XRRS, &
XRTHS_CLD, XRRS_CLD )
!
! At the initial instant the difference with the ref state creates a
! vertical velocity production that must not be advected as it is
! compensated by the pressure gradient
!
IF (KTCOUNT == 1 .AND. CCONF=='START') XRWS_PRES = - (XRWS - ZRWS)
!
CALL SECOND_MNH2(ZTIME2)
!
XT_GRAV = XT_GRAV + ZTIME2 - ZTIME1 - XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
!MPPDB_CHECK_LB=.TRUE.
CALL MPPDB_CHECK3DM("before ADVEC_UVW:XU/V/W/TH/TKE/T,XRHODJ,XRU/V/Ws",PRECISION,&
& XUT, XVT, XWT, XTHT, XTKET,XRHODJ,XRUS,XRVS,XRWS)
IF ((CUVW_ADV_SCHEME(1:3)=='CEN') .AND. (CTEMP_SCHEME == 'LEFR')) THEN

ESCOBAR MUNOZ Juan
committed
IF (CUVW_ADV_SCHEME=='CEN4TH') THEN
NULLIFY(TZFIELDC_ll)
NULLIFY(TZHALO2C_ll)
CALL ADD3DFIELD_ll(TZFIELDC_ll, XUT)
CALL ADD3DFIELD_ll(TZFIELDC_ll, XVT)
CALL ADD3DFIELD_ll(TZFIELDC_ll, XWT)
CALL INIT_HALO2_ll(TZHALO2C_ll,3,IIU,IJU,IKU)
CALL UPDATE_HALO_ll(TZFIELDC_ll,IINFO_ll)
CALL UPDATE_HALO2_ll(TZFIELDC_ll, TZHALO2C_ll, IINFO_ll)
END IF
CALL ADVECTION_UVW_CEN(CUVW_ADV_SCHEME, &
CLBCX, CLBCY, &
XTSTEP, KTCOUNT, &
XUM, XVM, XWM, XDUM, XDVM, XDWM, &
XUT, XVT, XWT, &
XRHODJ, XDXX, XDYY, XDZZ, XDZX, XDZY, &
XRUS,XRVS, XRWS, &
TZHALO2C_ll )

ESCOBAR MUNOZ Juan
committed
IF (CUVW_ADV_SCHEME=='CEN4TH') THEN
CALL CLEANLIST_ll(TZFIELDC_ll)
NULLIFY(TZFIELDC_ll)
CALL DEL_HALO2_ll(TZHALO2C_ll)
NULLIFY(TZHALO2C_ll)
END IF
ELSE
CALL ADVECTION_UVW(CUVW_ADV_SCHEME, CTEMP_SCHEME, &
NWENO_ORDER, LSPLIT_WENO, &
CLBCX, CLBCY, XTSTEP, &
XUT, XVT, XWT, &
XRHODJ, XDXX, XDYY, XDZZ, XDZX, XDZY, &
XRUS, XRVS, XRWS, &
XRUS_PRES, XRVS_PRES, XRWS_PRES )
END IF
!
CALL MPPDB_CHECK3DM("after ADVEC_UVW:XU/V/W/TH/TKE/T,XRHODJ,XRU/V/Ws",PRECISION,&
& XUT, XVT, XWT, XTHT, XTKET,XRHODJ,XRUS,XRVS,XRWS)
!MPPDB_CHECK_LB=.FALSE.
!
CALL SECOND_MNH2(ZTIME2)
!
XT_ADVUVW = XT_ADVUVW + ZTIME2 - ZTIME1 - XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
!
IF (NMODEL_CLOUD==IMI .AND. CTURBLEN_CLOUD/='NONE') THEN

WAUTELET Philippe
committed
CALL TURB_CLOUD_INDEX(XTSTEP,TZBAKFILE, &
LTURB_DIAG,GCLOSE_OUT,NRRI, &
XRRS,XRT,XRHODJ,XDXX,XDYY,XDZZ,XDZX,XDZY, &
XCEI )
END IF
!
!-------------------------------------------------------------------------------
!
!* 18. LATERAL BOUNDARY CONDITION FOR THE NORMAL VELOCITY
! --------------------------------------------------
!
ZTIME1 = ZTIME2
CALL MPPDB_CHECK3DM("before RAD_BOUND :XRU/V/WS",PRECISION,XRUS,XRVS,XRWS)
CALL RAD_BOUND (CLBCX,CLBCY,CTURB,XCARPKMAX, &
XTSTEP, &
XDXHAT, XDYHAT, XZHAT, &
XUT, XVT, &
XLBXUM, XLBYVM, XLBXUS, XLBYVS, &
XCPHASE, XCPHASE_PBL, XRHODJ, &
XTKET,XRUS, XRVS, XRWS )
ZRUS=XRUS-ZRUS
ZRVS=XRVS-ZRVS
ZRWS=XRWS-ZRWS
!
CALL SECOND_MNH2(ZTIME2)
!
XT_RAD_BOUND = XT_RAD_BOUND + ZTIME2 - ZTIME1
!
!-------------------------------------------------------------------------------
!
!* 19. PRESSURE COMPUTATION
! --------------------
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!

Gaelle DELAUTIER
committed
ZPABST = XPABST
CALL MPPDB_CHECK3DM("before pressurez:XRU/V/WS",PRECISION,XRUS,XRVS,XRWS)
XRUS_PRES = XRUS
XRVS_PRES = XRVS
XRWS_PRES = XRWS
!
CALL PRESSUREZ( CLBCX,CLBCY,CPRESOPT,NITR,LITRADJ,KTCOUNT, XRELAX,IMI, &
XRHODJ,XDXX,XDYY,XDZZ,XDZX,XDZY,XDXHATM,XDYHATM,XRHOM, &
XAF,XBFY,XCF,XTRIGSX,XTRIGSY,NIFAXX,NIFAXY, &
NRR,NRRL,NRRI,XDRYMASST,XREFMASS,XMASS_O_PHI0, &
XTHT,XRT,XRHODREF,XTHVREF,XRVREF,XEXNREF, XLINMASS, &
XRUS, XRVS, XRWS, XPABST, &
XBFB,&
XBF_SXP2_YP1_Z) !JUAN Z_SPLITING
!
XRUS_PRES = XRUS - XRUS_PRES + ZRUS
XRVS_PRES = XRVS - XRVS_PRES + ZRVS
XRWS_PRES = XRWS - XRWS_PRES + ZRWS
!
END IF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_PRESS = XT_PRESS + ZTIME2 - ZTIME1 &
- XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
!-------------------------------------------------------------------------------
!
!* 20. CHEMISTRY/AEROSOLS
! ------------------
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
IF (LUSECHEM) THEN
CALL CH_MONITOR_n(ZWETDEPAER,KTCOUNT,XTSTEP, ILUOUT, NVERB)
END IF
!
! For inert aerosol (dust and sea salt) => aer_monitor_n
IF ((LDUST).OR.(LSALT)) THEN
!
! tests to see if any cloud exists
!
GCLD=.TRUE.
IF (GCLD .AND. NRR.LE.3 ) THEN
IF( MAXVAL(XCLDFR(:,:,:)).LE. 1.E-10 .AND. GCLOUD_ONLY ) THEN
GCLD = .FALSE. ! only the cloudy verticals would be
! refreshed but there is no clouds
END IF
END IF
!
IF (GCLD .AND. NRR.GE.4 ) THEN
IF( CCLOUD(1:3)=='ICE' )THEN
IF( MAXVAL(XRT(:,:,:,2)).LE.XRTMIN(2) .AND. &
MAXVAL(XRT(:,:,:,4)).LE.XRTMIN(4) .AND. GCLOUD_ONLY ) THEN
GCLD = .FALSE. ! only the cloudy verticals would be
! refreshed but there is no cloudwater and ice
END IF
END IF
IF( CCLOUD=='C3R5' )THEN
IF( MAXVAL(XRT(:,:,:,2)).LE.XRTMIN_C1R3(2) .AND. &
MAXVAL(XRT(:,:,:,4)).LE.XRTMIN_C1R3(4) .AND. GCLOUD_ONLY ) THEN
GCLD = .FALSE. ! only the cloudy verticals would be
! refreshed but there is no cloudwater and ice
END IF
END IF
IF( CCLOUD=='LIMA' )THEN
IF( MAXVAL(XRT(:,:,:,2)).LE.XRTMIN_LIMA(2) .AND. &
MAXVAL(XRT(:,:,:,4)).LE.XRTMIN_LIMA(4) .AND. GCLOUD_ONLY ) THEN
GCLD = .FALSE. ! only the cloudy verticals would be
! refreshed but there is no cloudwater and ice
END IF
END IF
END IF
!
CALL AER_MONITOR_n(KTCOUNT,XTSTEP, ILUOUT, NVERB, GCLD)
END IF
!
!
CALL SECOND_MNH2(ZTIME2)
!
XT_CHEM = XT_CHEM + ZTIME2 - ZTIME1 &
- XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
ZTIME = ZTIME + XTIME_LES_BU_PROCESS + XTIME_BU_PROCESS
!-------------------------------------------------------------------------------
!
!* 20. WATER MICROPHYSICS
! ------------------
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
IF (CCLOUD /= 'NONE' .AND. CELEC == 'NONE') THEN
!
IF (CCLOUD == 'C2R2' .OR. CCLOUD == 'KHKO' .OR. CCLOUD == 'C3R5' &
.OR. CCLOUD == "LIMA" ) THEN
IF ( LFORCING ) THEN
ZWT_ACT_NUC(:,:,:) = XWT(:,:,:) + XWTFRC(:,:,:)
ELSE
ZWT_ACT_NUC(:,:,:) = XWT(:,:,:)
END IF
IF (CTURB /= 'NONE' ) THEN
IF ( ((CCLOUD=='C2R2'.OR.CCLOUD=='KHKO').AND.LACTTKE) .OR. (CCLOUD=='LIMA'.AND.MACTTKE) ) THEN
ZWT_ACT_NUC(:,:,:) = ZWT_ACT_NUC(:,:,:) + (2./3. * XTKET(:,:,:))**0.5
ELSE
ZWT_ACT_NUC(:,:,:) = ZWT_ACT_NUC(:,:,:)
ENDIF
ENDIF
ELSE
ZWT_ACT_NUC(:,:,:) = 0.
END IF
!
XRTHS_CLD = XRTHS
XRRS_CLD = XRRS
XRSVS_CLD = XRSVS
IF (CSURF=='EXTE') THEN
ALLOCATE (ZSEA(SIZE(XRHODJ,1),SIZE(XRHODJ,2)))
ALLOCATE (ZTOWN(SIZE(XRHODJ,1),SIZE(XRHODJ,2)))
ZSEA(:,:) = 0.
ZTOWN(:,:)= 0.
CALL MNHGET_SURF_PARAM_n (PSEA=ZSEA(:,:),PTOWN=ZTOWN(:,:))
CALL RESOLVED_CLOUD ( CCLOUD, CACTCCN, CSCONV, CMF_CLOUD, NRR, NSPLITR, &
NSPLITG, IMI, KTCOUNT, &
CLBCX,CLBCY,TZBAKFILE, CRAD, CTURBDIM, &
GCLOSE_OUT, LSUBG_COND,LSIGMAS,CSUBG_AUCV,XTSTEP, &
XZZ, XRHODJ, XRHODREF, XEXNREF, &

Gaelle DELAUTIER
committed
ZPABST, XTHT,XRT,XSIGS,VSIGQSAT,XMFCONV,XTHM,XRCM, &
XPABSM, ZWT_ACT_NUC,XDTHRAD, XRTHS, XRRS, &
LCONVHG, XCF_MF,XRC_MF, XRI_MF, &

Gaelle DELAUTIER
committed
XINPRC,ZINPRC3D,XINPRR, XINPRR3D, XEVAP3D, &
XINPRS,ZINPRS3D, XINPRG,ZINPRG3D, XINPRH,ZINPRH3D, &
XSOLORG, XMI,ZSPEEDC, ZSPEEDR, ZSPEEDS, ZSPEEDG, ZSPEEDH, &
XINDEP, XSUPSAT, XNACT, XNPRO,XSSPRO, XRAINFR, &
ZSEA, ZTOWN )
DEALLOCATE(ZTOWN)
ELSE
CALL RESOLVED_CLOUD ( CCLOUD, CACTCCN, CSCONV, CMF_CLOUD, NRR, NSPLITR, &
NSPLITG, IMI, KTCOUNT, &
CLBCX,CLBCY,TZBAKFILE, CRAD, CTURBDIM, &
XTSTEP,XZZ, XRHODJ, XRHODREF, XEXNREF, &

Gaelle DELAUTIER
committed
ZPABST, XTHT,XRT,XSIGS,VSIGQSAT,XMFCONV,XTHM,XRCM, &
XPABSM, ZWT_ACT_NUC,XDTHRAD, XRTHS, XRRS, &
LCONVHG, XCF_MF,XRC_MF, XRI_MF, &

Gaelle DELAUTIER
committed
XINPRC,ZINPRC3D,XINPRR, XINPRR3D, XEVAP3D, &
XINPRS,ZINPRS3D, XINPRG,ZINPRG3D, XINPRH,ZINPRH3D, &
XSOLORG, XMI,ZSPEEDC, ZSPEEDR, ZSPEEDS, ZSPEEDG, ZSPEEDH, &
XINDEP, XSUPSAT, XNACT, XNPRO,XSSPRO, XRAINFR )
XRTHS_CLD = XRTHS - XRTHS_CLD
XRRS_CLD = XRRS - XRRS_CLD
XRSVS_CLD = XRSVS - XRSVS_CLD
!
IF (CCLOUD /= 'REVE' ) THEN
XACPRR = XACPRR + XINPRR * XTSTEP
IF ( (CCLOUD(1:3) == 'ICE' .AND. LSEDIC ) .OR. &
.OR. CCLOUD == 'LIMA' ) .AND. KSEDC ) ) THEN
IF (LDEPOSC .OR. LDEPOC) XACDEP = XACDEP + XINDEP * XTSTEP
END IF
IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'C3R5' .OR. &
(CCLOUD == 'LIMA' .AND. LCOLD ) ) THEN
XACPRS = XACPRS + XINPRS * XTSTEP
XACPRG = XACPRG + XINPRG * XTSTEP
IF (CCLOUD == 'ICE4' .OR. (CCLOUD == 'LIMA' .AND. LHAIL)) XACPRH = XACPRH + XINPRH * XTSTEP
END IF
!
! Lessivage des CCN et IFN nucléables par Slinn
!
IF (LSCAV .AND. (CCLOUD == 'LIMA')) THEN
CALL LIMA_PRECIP_SCAVENGING(CCLOUD, ILUOUT, KTCOUNT,XTSTEP,XRT(:,:,:,3), &
XRHODREF, XRHODJ, XZZ, XPABST, XTHT, &
XSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), &
XRSVS(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), XINPAP )
!
XACPAP(:,:) = XACPAP(:,:) + XINPAP(:,:) * XTSTEP
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
END IF
END IF
!
! It is necessary that SV_C2R2 and SV_C1R3 are contiguous in the preceeding CALL
!
END IF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_CLOUD = XT_CLOUD + ZTIME2 - ZTIME1 &
- XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
!
!* 21. CLOUD ELECTRIFICATION AND LIGHTNING FLASHES
! -------------------------------------------
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
XTIME_LES_BU_PROCESS = 0.
!
IF (CELEC /= 'NONE' .AND. (CCLOUD(1:3) == 'ICE')) THEN
ZWT_ACT_NUC(:,:,:) = 0.
!
XRSVS_CLD = XRSVS
IF (CSURF=='EXTE') THEN
ALLOCATE (ZSEA(SIZE(XRHODJ,1),SIZE(XRHODJ,2)))
ALLOCATE (ZTOWN(SIZE(XRHODJ,1),SIZE(XRHODJ,2)))
ZSEA(:,:) = 0.
ZTOWN(:,:)= 0.
CALL MNHGET_SURF_PARAM_n (PSEA=ZSEA(:,:),PTOWN=ZTOWN(:,:))
CALL RESOLVED_ELEC_n (CCLOUD, CSCONV, CMF_CLOUD, &
NRR, NSPLITR, IMI, KTCOUNT, OEXIT, &
CLBCX, CLBCY, CRAD, CTURBDIM, &
LSUBG_COND, LSIGMAS,VSIGQSAT,CSUBG_AUCV, &

Gaelle DELAUTIER
committed
ZPABST, XTHT, XRTHS, XWT, XRT, XRRS, &
XSVT, XRSVS, XCIT, &
XSIGS, XSRCT, XCLDFR, XMFCONV, XCF_MF, XRC_MF, &
XRI_MF, LSEDIC, LWARM, &
XINPRC, XINPRR, XINPRR3D, XEVAP3D, &
XINPRS, XINPRG, XINPRH, &
ZSEA, ZTOWN )
DEALLOCATE(ZTOWN)
ELSE
CALL RESOLVED_ELEC_n (CCLOUD, CSCONV, CMF_CLOUD, &
NRR, NSPLITR, IMI, KTCOUNT, OEXIT, &
CLBCX, CLBCY, CRAD, CTURBDIM, &
LSUBG_COND, LSIGMAS,VSIGQSAT, CSUBG_AUCV, &

Gaelle DELAUTIER
committed
ZPABST, XTHT, XRTHS, XWT, &
XRT, XRRS, XSVT, XRSVS, XCIT, &
XSIGS, XSRCT, XCLDFR, XMFCONV, XCF_MF, XRC_MF, &
XRI_MF, LSEDIC, LWARM, &
XINPRC, XINPRR, XINPRR3D, XEVAP3D, &
XINPRS, XINPRG, XINPRH )
END IF
XRTHS_CLD = XRTHS - XRTHS_CLD
XRRS_CLD = XRRS - XRRS_CLD
XRSVS_CLD = XRSVS - XRSVS_CLD
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
!
XACPRR = XACPRR + XINPRR * XTSTEP
IF ((CCLOUD(1:3) == 'ICE' .AND. LSEDIC)) &
XACPRC = XACPRC + XINPRC * XTSTEP
IF (CCLOUD(1:3) == 'ICE') THEN
XACPRS = XACPRS + XINPRS * XTSTEP
XACPRG = XACPRG + XINPRG * XTSTEP
IF (CCLOUD == 'ICE4') XACPRH = XACPRH + XINPRH * XTSTEP
END IF
END IF
!
CALL SECOND_MNH2(ZTIME2)
!
XT_ELEC = XT_ELEC + ZTIME2 - ZTIME1 &
- XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------
!
!* 21. L.E.S. COMPUTATIONS
! -------------------
!
ZTIME1 = ZTIME2
!
CALL LES_n
!
CALL SECOND_MNH2(ZTIME2)
!
XT_SPECTRA = XT_SPECTRA + ZTIME2 - ZTIME1 + XTIME_LES_BU + XTIME_LES
!
!-------------------------------------------------------------------------------
!
!* 21. bis MEAN_UM
! --------------------
!
IF (LMEAN_FIELD) THEN
CALL MEAN_FIELD(XUT, XVT, XWT, XTHT, XTKET, XPABST)
END IF
!
!-------------------------------------------------------------------------------
!
!* 22. UPDATE HALO OF EACH SUBDOMAINS FOR TIME T+DT
! --------------------------------------------
!
ZTIME1 = ZTIME2
!
CALL EXCHANGE (XTSTEP,NRR,NSV,XRHODJ,TZFIELDS_ll, &
XRUS, XRVS,XRWS,XRTHS,XRRS,XRTKES,XRSVS)
!
CALL SECOND_MNH2(ZTIME2)
!
XT_HALO = XT_HALO + ZTIME2 - ZTIME1
!
!-------------------------------------------------------------------------------
!
!* 23. TEMPORAL SWAPPING
! -----------------
!
ZTIME1 = ZTIME2
XTIME_BU_PROCESS = 0.
!
CUVW_ADV_SCHEME,CTEMP_SCHEME,XRHODJ, &
XRUS,XRVS,XRWS,XDRYMASSS, &
XRTHS,XRRS,XRTKES,XRSVS, &
XLSUS,XLSVS,XLSWS, &
XLSTHS,XLSRVS, &
XLBXUS,XLBXVS,XLBXWS, &
XLBXTHS,XLBXRS,XLBXTKES,XLBXSVS, &
XLBYUS,XLBYVS,XLBYWS, &
XLBYTHS,XLBYRS,XLBYTKES,XLBYSVS, &
XLSUM,XLSVM,XLSWM, &
XLSTHM,XLSRVM, &
XLBXUM,XLBXVM,XLBXWM, &
XLBXTHM,XLBXRM,XLBXTKEM,XLBXSVM, &
XLBYUM,XLBYVM,XLBYWM, &
!
CALL SECOND_MNH2(ZTIME2)
!
XT_STEP_SWA = XT_STEP_SWA + ZTIME2 - ZTIME1 - XTIME_BU_PROCESS
!
!-------------------------------------------------------------------------------